Lachim / redis

Automatically exported from code.google.com/p/redis
2 stars 0 forks source link

redis-cli should remember selected database to recover from client idle timeouts #504

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What version of Redis you are using, in what kind of Operating System?

redis 2.2.2, Linux (Ubuntu 10.10)

What is the problem you are experiencing?

redis-cli automatically reconnects to the server after a client timeout but 
does not re-select the database. It's therefore impossible to reliably know 
what database you're issuing commands against.

What steps will reproduce the problem?

1. Set low timeout and start redis-server.
2. Connect with redis-cli.
3. redis-cli: "select 1" -> "OK"
4. redis-cli: "incr count" -> "(integer) 1"
5. Wait for "Closing idle client" message in redis-server logs.
6. redis-cli: "incr count" -> "(integer) 1)

At step 6, redis-cli automatically reconnects but does not re-select database. 
Therefore, databases 0 and 1 now both contain a count key.

Original issue reported on code.google.com by matt.goo...@gmail.com on 1 Apr 2011 at 12:16

GoogleCodeExporter commented 8 years ago
This is a known issue and is fixed. Will be released in 2.2.3, thanks for 
reporting.

Original comment by pcnoordh...@gmail.com on 1 Apr 2011 at 12:24

GoogleCodeExporter commented 8 years ago
Oh, sorry - I didn't search the closed tickets first.

Original comment by matt.goo...@gmail.com on 1 Apr 2011 at 12:27

GoogleCodeExporter commented 8 years ago
No problem :-)

Original comment by pcnoordh...@gmail.com on 1 Apr 2011 at 12:36