Fix manager/state/store.timedMutex#2603
Conversation
|
Please sign your commits following these rules: $ git clone -b "patch-1" git@github.com:Adirio/swarmkit.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -fAmending updates the existing PR. You DO NOT need to open a new one. |
Signed-off-by: Adrián Orive <aorive@ikerlan.es> #2602
Codecov Report
@@ Coverage Diff @@
## master #2603 +/- ##
==========================================
+ Coverage 61.58% 62.16% +0.58%
==========================================
Files 134 134
Lines 21763 21763
==========================================
+ Hits 13403 13530 +127
+ Misses 6918 6778 -140
- Partials 1442 1455 +13 |
|
ci/circleci reporting: Is this change really making the difference? |
There was a problem hiding this comment.
@Adirio Thanks for finding and submitting this fix. The TestNodeAllocator is a flakey test, and the failure is probably unrelated. I've kicked off a rebuild.
LGTM pending CI - this seems like if there is a context switch at an inopportune time, it could potentially cause swarm to occasionally fail to detect a wedge, since LockedAt().IsZero() would return true and hence Wedged() would return false. I can't think of a good way to unit test this change, though.
|
Thank you two for the revission. I changed the PR description to incorporate the just merged template. |
|
Thanks @aaronlehmann and @Adirio! |
Relevant changes: - moby/swarmkit#2551 RoleManager will remove deleted nodes from the cluster membership - moby/swarmkit#2574 Scheduler/TaskReaper: handle unassigned tasks marked for shutdown - moby/swarmkit#2561 Avoid predefined error log - moby/swarmkit#2557 Task reaper should delete tasks with removed slots that were not yet assigned - moby/swarmkit#2587 [fips] Agent reports FIPS status - moby/swarmkit#2603 Fix manager/state/store.timedMutex Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Relevant changes: - moby/swarmkit#2551 RoleManager will remove deleted nodes from the cluster membership - moby/swarmkit#2574 Scheduler/TaskReaper: handle unassigned tasks marked for shutdown - moby/swarmkit#2561 Avoid predefined error log - moby/swarmkit#2557 Task reaper should delete tasks with removed slots that were not yet assigned - moby/swarmkit#2587 [fips] Agent reports FIPS status - moby/swarmkit#2603 Fix manager/state/store.timedMutex Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 333b2f28fef4ba857905e7263e7b9bbbf7c522fc Component: engine
Relevant changes: - moby/swarmkit#2551 RoleManager will remove deleted nodes from the cluster membership - moby/swarmkit#2574 Scheduler/TaskReaper: handle unassigned tasks marked for shutdown - moby/swarmkit#2561 Avoid predefined error log - moby/swarmkit#2557 Task reaper should delete tasks with removed slots that were not yet assigned - moby/swarmkit#2587 [fips] Agent reports FIPS status - moby/swarmkit#2603 Fix manager/state/store.timedMutex Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit 333b2f28fef4ba857905e7263e7b9bbbf7c522fc) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- What I did
Fix for #2602
- How I did it
Move the conflicting operation inside the critical section (before the
Unlock()call).- How to test it
- Description for the changelog
Fix #2602: timedMutex critical operation outside of critical section