This repository was archived by the owner on Oct 13, 2023. It is now read-only.
[17.07] cluster: Avoid recursive RLock#178
Merged
andrewhsu merged 1 commit intoAug 4, 2017
Merged
Conversation
GetTasks can call GetService and GetNode with the read lock held. These methods try to aquire the read side of the same lock. According to the sync package documentation, this is not safe: > If a goroutine holds a RWMutex for reading, it must not expect this or > any other goroutine to be able to also take the read lock until the > first read lock is released. In particular, this prohibits recursive > read locking. This is to ensure that the lock eventually becomes > available; a blocked Lock call excludes new readers from acquiring the > lock. Fix GetTasks to use the lower-level getService and getNode methods instead. Also, use lockedManagerAction to simplify GetTasks. Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com> (cherry picked from commit bd4f66c) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Contributor
|
LGTM |
Contributor
|
Test failures are known as per #140: Checked with this script: https://gist.github.com/seemethere/6128cb2391cd43b65b0ff4880af427e5 |
docker-jenkins
pushed a commit
that referenced
this pull request
Sep 4, 2018
[master] bump Go to 1.10.4 Upstream-commit: 93bf7f2 Component: packaging
docker-jenkins
pushed a commit
that referenced
this pull request
Mar 28, 2019
[18.09 backport] Use original process spec for execs Upstream-commit: b4bf217633d7884999b675b8a7b9b81892b46086 Component: engine
silvin-lubecki
pushed a commit
to silvin-lubecki/docker-ce
that referenced
this pull request
Feb 3, 2020
…void-recursive-rlock [17.07] cluster: Avoid recursive RLock
akrasnov-drv
pushed a commit
to drivenets/docker-ce
that referenced
this pull request
Apr 23, 2023
[master] bump Go to 1.10.4
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Cherry-picked from moby/moby@bd4f66c (moby/moby#34235)
no conflicts
ping @aaronlehmann @fcrisciani @tonistiigi
GetTasks can call GetService and GetNode with the read lock held. These
methods try to aquire the read side of the same lock. According to the
sync package documentation, this is not safe:
Fix GetTasks to use the lower-level getService and getNode methods
instead. Also, use lockedManagerAction to simplify GetTasks.