Skip to content

a RESET command for reseting client state ? #5571

@tzickel

Description

@tzickel

I was thinking that redis needs a RESET command that would make an existing client connection forget all the state it keeps with regards to transactions, watches, pubsub channels (and everything else that might be stateful in the future) and always returns always successfully OK or RESET (the latter might be easier to look for without parsing the sent commands).

This can be very useful in the context of a client library which uses connection pooling.

If you want to reuse an existing socket connection to the server in the pool, you must be sure that the connection is in an empty state before adding it back to the pool, since the user might issue commands that are not-safe between different contexts.

Doing it manually requires quite a bit of parsing and book keeping with regards to which commands were sent and what their side effects are (and if they executed ok).

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions