Deadlock when using cluster connection #326

Closed
guperrot opened this Issue Aug 2, 2016 · 3 comments

Projects

None yet

2 participants

@guperrot
guperrot commented Aug 2, 2016

Hi,

We had our first dead lock caused by lettuce in a production service. It happened only once so far (have used the library in production for 1 month). We use the version 4.2.0.Final.

Basically the dead lock happened in lettuce internals between the lettuce-eventExecutorLoop thread and the lettuce-nioEventLoop thread.

I attach to this issue a filtered jstack output showing the deadlock. In that state all API calls are never returning when using the async API.

lettuce-deadlock.txt

@mp911de mp911de added the bug label Aug 3, 2016
@mp911de
Owner
mp911de commented Aug 3, 2016

Thanks for the bug report. I'll take care of this.

@mp911de mp911de added a commit that referenced this issue Aug 3, 2016
@mp911de Replace synchronized setters with volatile fields #326
Synchronization at the level of activation can cause a deadlock if connection close is in progress and a different thread performs reconnect/activation at the same time. The previous synchronization was intended to enforce a happens-before relation and to solve visibility issues.
f389bc2
@mp911de mp911de added a commit that referenced this issue Aug 3, 2016
@mp911de Replace synchronized setters with volatile fields #326
Synchronization at the level of activation can cause a deadlock if connection close is in progress and a different thread performs reconnect/activation at the same time. The previous synchronization was intended to enforce a happens-before relation and to solve visibility issues.
0f30531
@mp911de mp911de added this to the Lettuce 4.2.2 milestone Aug 3, 2016
@mp911de
Owner
mp911de commented Aug 3, 2016

That's fixed and will be released with 4.2.2 and 4.3.0.

@mp911de mp911de closed this Aug 3, 2016
@guperrot
guperrot commented Aug 3, 2016

Hi, that was fast, thanks. I will watch for the upcoming release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment