redis-rb / redis-client

Simple low level client for Redis 6+
MIT License
124 stars 60 forks source link

Rescue OpenSSL::SSL::SSLError for write and write_multi #180

Closed ngan closed 7 months ago

ngan commented 7 months ago

While on version 4 of the redis gem, we had a monkey patch to rescue SSL_read: shutdown while in init errors as suggested here: https://github.com/redis/redis-rb/issues/1174#issuecomment-1412993295

This worked fine until we upgrade to redis version 5 and our patch wasn't being applied anymore. We recently have been seeing: SSL_write: shutdown while in init (notice that it's write instead of read). I realized that the redis-client code was rescuing SSL errors for the read: https://github.com/redis-rb/redis-client/blob/master/lib/redis_client/ruby_connection.rb#L102

But it wasn't doing it for write. This PR adds rescuing of OpenSSL::SSL::SSLError to write and write_multi.

mperham commented 7 months ago

I think this has been affecting a small number of Sidekiq users since 7.0. 🙁 but I’m happy you found it.