Runner stop deadlock#1037
Closed
jabolina wants to merge 1 commit into
Closed
Conversation
* Runner.stop and run methods compete for the same intrinsic lock when stopping.
Owner
Owner
|
Hi @jabolina |
Collaborator
Author
|
Correct, they eventually proceed after |
Owner
|
Why the word 'deadlock' then? |
Owner
|
OK, I see that the advantage of this change is for the runner to go from |
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.
Runner.stopandrunmethods compete for the same intrinsic lock when stopping.t1: Thestop()method is in a synchronized block and updates the state tostopping;t1: While holding the lock, thestopmethod callsThread.join(timeout)in the stopping thread.t2: Therun()methods seesstate != runningand proceed to stop;t2: Therun()method tries to acquire the same intrinsic lock held byt1, currently inThread.join.t1: Timeout instop()elapses and the method returns; the lock is released.t2: Therun()method acquires the intrinsic lock and updatesstate = stopped.