redis / redis-rb

A Ruby client library for Redis
MIT License
3.96k stars 1.03k forks source link

Restore connection.timeout correctly for Redis::Client#with_socket_timeout in 4.x #1254

Closed yoshihara closed 7 months ago

yoshihara commented 7 months ago

I use redis gem 4.8.1 in my application, so I found this problem.

After block is called in Redis::Client#with_socket_timeout, conneciton.timeout can't be restored correctly in 4.x implementation, I guess. Because self.timeout returns @options[:read_timeout] restored after connection.timeout. This causes the bug that with_socket_timeout uses wrong timeout value unexpectedly.

I can't find the tests for Redis::Client#with_socket_timeout, so I couldn't wirte one, sorry.

byroot commented 7 months ago

Thanks for the patch, but the 4.x branch is no longer maintained.

yoshihara commented 7 months ago

Oh sorry, thank you for reply soon.