Fix Deadlock in HotThreadsIT#39118
Closed
original-brownbear wants to merge 2 commits intoelastic:masterfrom
original-brownbear:experimenting-stab
Closed
Fix Deadlock in HotThreadsIT#39118original-brownbear wants to merge 2 commits intoelastic:masterfrom original-brownbear:experimenting-stab
original-brownbear wants to merge 2 commits intoelastic:masterfrom
original-brownbear:experimenting-stab
Conversation
The way this dead-locks is: * The `size` method on the internal cluster needs a monitor on the internal cluster object in the select thread on node_1 * `client()` call on the test thread connects to node_1 at the same time, holding the monitor on the internal test cluster during the connect call * That connect can not finish because the select loop that would dispatch it is blocked waiting for the `size()` call to complete => Deadlock
Collaborator
|
Pinging @elastic/es-distributed |
This was referenced Feb 19, 2019
DaveCTurner
requested changes
Feb 20, 2019
Member
DaveCTurner
left a comment
There was a problem hiding this comment.
I think this is an issue in InternalTestCluster and we should try and fix it at source rather than here. If there are not already other places we call cluster().size() in a way that might lead to deadlock, there will be in future.
Contributor
Author
|
@DaveCTurner fair point, a more global fix is WIP in #39168 :) (sorry for not noting this here) I'll close here, the other PR should be ready in a few minutes :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The way this dead-locks is:
The
sizemethod on the internal cluster needs a monitor on the internal cluster object in the select thread on node_1client()call on the test thread connects to node_1 at the same time, holding the monitor on the internal test cluster during the connect callsize()call to complete => DeadlockCloses [CI] HotThreadsIT.testHotThreadsDontFail failure on master #37965
Relates [CI] multiple tests started failing with NoNodeAvailableException #37275
Blocked size call:
Blocked connect call (will only unblock if the above finishes since the above blocks the select loop):