Skip to content

Automatic reconnect behavior inconsistent #1757

@johannes85

Description

@johannes85

Expected behaviour

When automatically reconnect the auth command should always be send.

Actual behaviour

When the server wents away the reconnect sends the auth command, but when reconnecting after calling the close method the auth command isn't sent.

I'm seeing this behaviour on

  • OS: Debian Jessie
  • Redis: 6.0.1
  • PHP: 7.2.30
  • phpredis: 5.2.2

Steps to reproduce, backtrace or example script

Works:

$client = new \Redis();
$client->connect('127.0.0.1', 6379);
$client->auth('foo');
$client->set('foo', 'bar');
sleep(10);  // Restarting redis server while script is waiting
$client->set('foo', 'bar');

Isn't working, produces PHP Fatal error: Uncaught RedisException: NOAUTH Authentication required.

$client = new \Redis();
$client->connect('127.0.0.1', 6379);
$client->auth('foo');
$client->set('foo', 'bar');
$client->close();
$client->set('foo', 'bar');

I've checked

  • There is no similar issue from other users
  • Issue isn't fixed in develop branch

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions