Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watchapi: Terminate RPCs when the manager shuts down #2310

Merged
merged 1 commit into from
Jul 19, 2017

Conversation

aaronlehmann
Copy link
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
Member

LGTM

@codecov
Copy link

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>
@cyli
Copy link
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