Skip to content

watchapi: Terminate RPCs when the manager shuts down#2310

Merged
aaronlehmann merged 1 commit intomoby:masterfrom
aaronlehmann:clean-shutdown-watch-server
Jul 19, 2017
Merged

watchapi: Terminate RPCs when the manager shuts down#2310
aaronlehmann merged 1 commit intomoby:masterfrom
aaronlehmann:clean-shutdown-watch-server

Conversation

@aaronlehmann
Copy link
Copy Markdown
Collaborator

Because we use GracefulStop, RPCs need to finish on their own when the
manager shuts down.

The watchapi server formerly was completely stateless, and didn't have a
notion of starting or stopping.

This adds Start and Stop functions that control a context, adapted from
the logbroker code. When the context is cancelled, outstanding RPCs will
finish.

There are also some related cleanups and fixes in the logbroker code.

Fixes #2307

cc @dperny

@aluzzardi
Copy link
Copy Markdown
Member

LGTM

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 14, 2017

Codecov Report

Merging #2310 into master will decrease coverage by 0.01%.
The diff coverage is 68.75%.

@@            Coverage Diff             @@
##           master    #2310      +/-   ##
==========================================
- Coverage   61.26%   61.24%   -0.02%     
==========================================
  Files         128      128              
  Lines       20579    20587       +8     
==========================================
+ Hits        12608    12609       +1     
+ Misses       6594     6589       -5     
- Partials     1377     1389      +12

Because we use GracefulStop, RPCs need to finish on their own when the
manager shuts down.

The watchapi server formerly was completely stateless, and didn't have a
notion of starting or stopping.

This adds Start and Stop functions that control a context, adapted from
the logbroker code. When the context is cancelled, outstanding RPCs will
finish.

There are also some related cleanups and fixes in the logbroker code.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
@aaronlehmann aaronlehmann force-pushed the clean-shutdown-watch-server branch from e10cbe5 to 6a9946b Compare July 14, 2017 21:15
@cyli
Copy link
Copy Markdown
Contributor

cyli commented Jul 19, 2017

LGTM

@aaronlehmann aaronlehmann merged commit 6abf7e6 into moby:master Jul 19, 2017
@aaronlehmann aaronlehmann deleted the clean-shutdown-watch-server branch July 19, 2017 00:52
silvin-lubecki pushed a commit to silvin-lubecki/docker-ce that referenced this pull request Feb 3, 2020
- moby/swarmkit#2288 (Allow updates of failed services with restart policy "none")
- moby/swarmkit#2304 (Reset restart history when task spec changes)
- moby/swarmkit#2309 (updating the service spec version when rolling back)
- moby/swarmkit#2310 (fix for slow swarm shutdown)

Signed-off-by: Ying <ying.li@docker.com>
silvin-lubecki pushed a commit to silvin-lubecki/docker-ce that referenced this pull request Feb 3, 2020
- moby/swarmkit#2309 (updating the service spec version when rolling back)
- moby/swarmkit#2310 (fix for slow swarm shutdown)
- moby/swarmkit#2323 (run watchapi server on all managers)

Signed-off-by: Ying <ying.li@docker.com>
silvin-lubecki pushed a commit to silvin-lubecki/engine-extract that referenced this pull request Feb 3, 2020
- moby/swarmkit#2309 (updating the service spec version when rolling back)
- moby/swarmkit#2310 (fix for slow swarm shutdown)
- moby/swarmkit#2323 (run watchapi server on all managers)

Signed-off-by: Ying <ying.li@docker.com>
silvin-lubecki pushed a commit to silvin-lubecki/engine-extract that referenced this pull request Feb 3, 2020
- moby/swarmkit#2288 (Allow updates of failed services with restart policy "none")
- moby/swarmkit#2304 (Reset restart history when task spec changes)
- moby/swarmkit#2309 (updating the service spec version when rolling back)
- moby/swarmkit#2310 (fix for slow swarm shutdown)

Signed-off-by: Ying <ying.li@docker.com>
silvin-lubecki pushed a commit to silvin-lubecki/engine-extract that referenced this pull request Mar 10, 2020
- moby/swarmkit#2309 (updating the service spec version when rolling back)
- moby/swarmkit#2310 (fix for slow swarm shutdown)
- moby/swarmkit#2323 (run watchapi server on all managers)

Signed-off-by: Ying <ying.li@docker.com>
glours pushed a commit to silvin-lubecki/engine-extract that referenced this pull request Mar 11, 2020
- moby/swarmkit#2288 (Allow updates of failed services with restart policy "none")
- moby/swarmkit#2304 (Reset restart history when task spec changes)
- moby/swarmkit#2309 (updating the service spec version when rolling back)
- moby/swarmkit#2310 (fix for slow swarm shutdown)

Signed-off-by: Ying <ying.li@docker.com>
silvin-lubecki pushed a commit to silvin-lubecki/engine-extract that referenced this pull request Mar 17, 2020
- moby/swarmkit#2288 (Allow updates of failed services with restart policy "none")
- moby/swarmkit#2304 (Reset restart history when task spec changes)
- moby/swarmkit#2309 (updating the service spec version when rolling back)
- moby/swarmkit#2310 (fix for slow swarm shutdown)

Signed-off-by: Ying <ying.li@docker.com>
silvin-lubecki pushed a commit to silvin-lubecki/engine-extract that referenced this pull request Mar 23, 2020
- moby/swarmkit#2288 (Allow updates of failed services with restart policy "none")
- moby/swarmkit#2304 (Reset restart history when task spec changes)
- moby/swarmkit#2309 (updating the service spec version when rolling back)
- moby/swarmkit#2310 (fix for slow swarm shutdown)

Signed-off-by: Ying <ying.li@docker.com>
silvin-lubecki pushed a commit to silvin-lubecki/engine-extract that referenced this pull request Mar 23, 2020
- moby/swarmkit#2309 (updating the service spec version when rolling back)
- moby/swarmkit#2310 (fix for slow swarm shutdown)
- moby/swarmkit#2323 (run watchapi server on all managers)

Signed-off-by: Ying <ying.li@docker.com>
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.

Manager shutdown hanging in GracefulStop

3 participants