Skip to content

[bump_v17.06] Adding Task State Remove and other fixes#2623

Merged
anshulpundir merged 7 commits into
moby:bump_v17.06from
nishanttotla:17.06-task-state-remove
Jun 5, 2018
Merged

[bump_v17.06] Adding Task State Remove and other fixes#2623
anshulpundir merged 7 commits into
moby:bump_v17.06from
nishanttotla:17.06-task-state-remove

Conversation

@nishanttotla
Copy link
Copy Markdown
Contributor

This is a cherry-pick of the following PRs in order. Several commits did not apply cleanly.

#2461
#2473
#2574
#2557
#2614

git cherry-pick -s -x b9e2c2f40bab1ea0f5d11ba6d999290360cc3bc9
git cherry-pick -s -x e5b310727c4c8b186c774b4e28d154c3fb4e32b8
git cherry-pick -s -x e3fcf6d9c553e9c69f83df6c49364eb270e62445
git cherry-pick -s -x 88064b5e2a8ca3431285333b37176a13db357648
git cherry-pick -s -x 7f638251835ccc3d791f128e3dbad76ccb9aaebd
git cherry-pick -s -x bef2bd052936d3aefe36cc7e8f6fefeb593e2531

Ping @chungers @anshulpundir @dperny @cyli @rchourasia

@andrewhsu andrewhsu changed the title Adding Task State Remove and other fixes [bump_v17.06] Adding Task State Remove and other fixes May 7, 2018
@nishanttotla
Copy link
Copy Markdown
Contributor Author

CI failures are due to #2614. But that PR is being cherry-picked separately here: #2627

Once that is merged, I will remove the commit here and rebase.

@nishanttotla nishanttotla force-pushed the 17.06-task-state-remove branch 2 times, most recently from 3230713 to eb61955 Compare May 11, 2018 00:48
@nishanttotla
Copy link
Copy Markdown
Contributor Author

Rebased on #2627.

@anshulpundir
Copy link
Copy Markdown
Contributor

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")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctx should just be context.TODO()

@nishanttotla
Copy link
Copy Markdown
Contributor Author

Fixed the CI failure. It was due to out of order cherry-picking because #2614 was cherry-picked first due to urgent requirement.

@nishanttotla
Copy link
Copy Markdown
Contributor Author

Current CI failure is due to the flaky test that is fixed in #2575. I'd have liked to cherry-pick from that PR too, but it's too complicated and will make this hard to review.

cc @cyli

nishanttotla and others added 6 commits June 4, 2018 16:06
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>
@nishanttotla nishanttotla force-pushed the 17.06-task-state-remove branch from 6c06334 to bf59047 Compare June 4, 2018 23:08
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2018

Codecov Report

Merging #2623 into bump_v17.06 will decrease coverage by 0.69%.
The diff coverage is 53.84%.

@@               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

@nishanttotla nishanttotla force-pushed the 17.06-task-state-remove branch from ec44f39 to 22fa2cf Compare June 5, 2018 04:43
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
@nishanttotla nishanttotla force-pushed the 17.06-task-state-remove branch from 22fa2cf to 69c2034 Compare June 5, 2018 06:38
@dperny
Copy link
Copy Markdown
Collaborator

dperny commented Jun 5, 2018

LGTM. Did we ever figure out why, initially, things were failing with the original patch?

@anshulpundir anshulpundir merged commit 34f7a91 into moby:bump_v17.06 Jun 5, 2018
@nishanttotla nishanttotla deleted the 17.06-task-state-remove branch June 5, 2018 17:59
@nishanttotla
Copy link
Copy Markdown
Contributor Author

@dperny we did, and this PR includes a couple of the fixes we put in for that.

@okrangerb3
Copy link
Copy Markdown

Is this the same issue? and is it resolved in this version?
https://docs.docker.com/ee/engine/release-notes/#17062-ee-13-2018-06-04
17.06.2-ee-13 (2018-06-04)
Networking
Fix attachable containers that may leave DNS state when exiting. moby/libnetwork#2175

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants