Open bst2002git opened 3 years ago
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: https://github.com/colinmollenhour/php-redis-session-abstract/blob/8d684bbacac99450f2a9ddf6f56be296997e2959/src/Cm/RedisSession/Handler.php#L303
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
Thanks for the report, would you like to submit a PR with the "throw" fix?
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: https://github.com/colinmollenhour/php-redis-session-abstract/blob/8d684bbacac99450f2a9ddf6f56be296997e2959/src/Cm/RedisSession/Handler.php#L303
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