Closed film42 closed 1 year ago
Seemed like a good time to migrate over to RedisError as well since it's more specific and works with everything in the custome redis wrapper.
RE: Checking for io errors from redis, this seems like the best way to detect a failure. The underlying TcpStream from tokio does not have a way to know if the stream was closed or not.
Example errors that were recovered:
Feb 12 06:32:17.328 ERRO Error leaked out the bottom: Broken pipe (os error 32)
Feb 12 06:34:36.897 ERRO Error leaked out the bottom: unexpected end of file
And the bb8 conn pool timeout is returned but is recoverable:
Feb 12 06:36:27.911 ERRO Error leaked out the bottom: TimedOut
Although I'm not sure why this was failing on windows subsystem for linux because the io error check is working, but for whatever reason, the check in redis-rs is not being used?
When an IO error is detected, we should be safe to assume the connection is down and needs to be recreated. Without this, it's possible for a process to be stuck in a loop that never recovers even though redis has come back online.Updating the description:
Feel free to read the log below even though the real fix is found in #26 . Some of these changes are good and you can see how clippy fixes make the code easier and maybe even faster.