currently there is space between checking/establishing connection (1) and performing some action (2), and this space is increased due to synchronization
establish_connection unless connected? # (1)
@semaphore.synchronize do
yield # (2)
end
as result we could have concurrent issue in place where all threads pass checking/establishing connection (1) and are waiting to perform action (2), if in one of such threads connection will be lost, it will retry to establish new connection but during this time rest of threads will fail with exception like:
gems/redic-1.5.0/lib/redic/client.rb:30:in `write'
RuntimeError: not connected
currently there is space between checking/establishing connection (1) and performing some action (2), and this space is increased due to synchronization
as result we could have concurrent issue in place where all threads pass checking/establishing connection (1) and are waiting to perform action (2), if in one of such threads connection will be lost, it will retry to establish new connection but during this time rest of threads will fail with exception like: