Skip to content

Sentinel config, Round-Robin, Sentinel Server not reachable #43

Open
@bst2002git

Description

@bst2002git

Hello,

when using Redis-Sentinel settings in Magento 2.3.x for example in the Config-Section
'session' => [
'save' => 'redis',
'redis' => [
'sentinel_servers' => 'tcp://10.0.0.30:26379,tcp://10.0.0.31:26379,tcp://10.0.0.32:26379',

and one of the Sentinel-Servers is not reachable for some reason, for ex. the first 10.0.0.30 (this is also the Server used through your program logic), see Link:

for ($i = 0; $i <= $sentinelConnectRetries; $i++) // Try to connect to sentinels in round-robin fashion

nothing works anymore, because of the not correct CredisException handlig.

If the Sentinel-Server is not reachabel, the Credis Client.php (see Link: https://github.com/colinmollenhour/credis/issues/new?permalink=https%3A%2F%2Fgithub.com%2Fcolinmollenhour%2Fcredis%2Fblob%2F464804e67d0fe5707c9035c986f3850f83d9d177%2FClient.php%23L497 )

throws the Error but does not include the Error-Number (111) which can be used in Handler.php on Line https://github.com/colinmollenhour/credis/issues/new?permalink=https%3A%2F%2Fgithub.com%2Fcolinmollenhour%2Fcredis%2Fblob%2F464804e67d0fe5707c9035c986f3850f83d9d177%2FClient.php%23L497

Your Line:
throw new CredisException("Connection to Redis {$this->host}:{$this->port} failed after $failures failures." . (isset($errno) && isset($errstr) ? "Last Error : ({$errno}) {$errstr}" : ""));

My Line:
throw new CredisException("Connection to Redis {$this->host}:{$this->port} failed after $failures failures." . (isset($errno) && isset($errstr) ? "Last Error : ({$errno}) {$errstr}" : ""), $errno);

How the "Round-Robin" for-loop should work, i don't know...

And if the rest works (Sentinel without Pass) i haven't tested

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions