[bump_v17.06] Adding Task State Remove and other fixes#2623
Conversation
3230713 to
eb61955
Compare
|
Rebased on #2627. |
|
I guess the apply to task_reaper.go is not clean causing CI failure @nishanttotla |
| } | ||
| removeTasks, err = store.FindTasks(readTx, store.ByDesiredState(api.TaskStateRemove)) | ||
| if err != nil { | ||
| log.G(ctx).WithError(err).Error("failed to find tasks with desired state REMOVE in task reaper init") |
There was a problem hiding this comment.
ctx should just be context.TODO()
|
Fixed the CI failure. It was due to out of order cherry-picking because #2614 was cherry-picked first due to urgent requirement. |
Set task desired state to REMOVE for service removal and scale down. Tasks in REMOVE state can be deleted after they are reported SHUTDOWN. Avoids a race conditions where network resources are freed before the running task has shut down fully. Add unit tests for Task state REMOVE behavior. Started by Nishant Totla <nishanttotla@gmail>, finished by Drew Erny <drew.erny@docker.com>. Signed-off-by: Nishant Totla <nishanttotla@gmail.com> Signed-off-by: Drew Erny <drew.erny@docker.com> (cherry picked from commit b9e2c2f) Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Tasks in the complete state were not cleaned up because the task reaper was only looking at task.Status.State >= api.TaskStateShutdown, but the COMPLETE state (api.TaskStateCompleted) is the actual "first" terminal state. Added a test for the initialization stage of the task repear. This runs the logic of which tasks to clean up through its paces, but doesn't test the run-time logic of the task reaper (it's ability to respond to updates to tasks). Signed-off-by: Drew Erny <drew.erny@docker.com> (cherry picked from commit e5b3107) Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
… running. Signed-off-by: Anshul Pundir <anshul.pundir@docker.com> (cherry picked from commit e3fcf6d) Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
…n assigned but have been marked for shutdown. Signed-off-by: Anshul Pundir <anshul.pundir@docker.com> (cherry picked from commit 88064b5) Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
…assigned Signed-off-by: Nishant Totla <nishanttotla@gmail.com> (cherry picked from commit 7f63825) Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
6c06334 to
bf59047
Compare
Codecov Report
@@ Coverage Diff @@
## bump_v17.06 #2623 +/- ##
===============================================
- Coverage 61.61% 60.91% -0.7%
===============================================
Files 42 121 +79
Lines 5692 20202 +14510
===============================================
+ Hits 3507 12306 +8799
- Misses 1842 6546 +4704
- Partials 343 1350 +1007 |
ec44f39 to
22fa2cf
Compare
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
22fa2cf to
69c2034
Compare
|
LGTM. Did we ever figure out why, initially, things were failing with the original patch? |
|
@dperny we did, and this PR includes a couple of the fixes we put in for that. |
|
Is this the same issue? and is it resolved in this version? |
This is a cherry-pick of the following PRs in order. Several commits did not apply cleanly.
#2461
#2473
#2574
#2557
#2614
Ping @chungers @anshulpundir @dperny @cyli @rchourasia