Does ioredis close connections due to timeouts at client side?
Hi,
Sure Im missing something and you can help me on knowing what Im missing here, but from my understanding the REDIS protocol is quite simple and by default does not support pipelining, so you can have only one inflight request per TCP stream at any time, this is well explained here [1]
Indeed, unless Im missing something here, the pipeline operation is from my understanding a wrapper for batching multiple operations into one single bigger "operation".
Under that context I always thought that errors like timeouts in the client side would have as a consequence that the connection can not be reused. For example, consider a scenario where everything is healthy but the client is times out before reading the data of the response, but considering that the data will eventually reach the TCP buffer. In that scenario nothing can be done except closing the TCP connection since there is no clue if the connection is in a good or bad state, and keeping it open might result on returning the response from the legit command to the next one.
As an example, here [2] the please in the Redis client for Golang where this happens, in case of a cancellation - Timeout - the connection is preventively closed.
Is this scenario really managed by Ioredis? Is this something that is expected to be managed by the caller? or am I missing something here?
Thanks!
[1] https://redis.io/docs/reference/protocol-spec/#request-response-model [2] https://github.com/go-redis/redis/blob/e061db8c13fd6b5e007d73370873026e360719de/error.go#L73
Source: redis/ioredis