Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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)
- Loading branch information