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

Ftr: Gracefully shutdown #255

Merged
merged 13 commits into from
Nov 23, 2019
Merged

Conversation

flycash
Copy link
Member

@flycash flycash commented Nov 15, 2019

What this PR does:
Gracefully shutdown. The steps are:

  1. Destroy all registries;
  2. wait for the new request for a short time
  3. provider rejects new request and then wait for processing all requests;
  4. consumer rejects sending new request and then wait for response
  5. invoke custome shutdown callback
    Which issue(s) this PR fixes:

Fixes #239

Special notes for your reviewer:

Please check the order of releasing resources.

Does this PR introduce a user-facing change?:

Now the application can shutdown gracefully

@flycash
Copy link
Member Author

flycash commented Nov 15, 2019

It seems that the syscall.SIGEMT cannot be found in CI.

@flycash
Copy link
Member Author

flycash commented Nov 15, 2019

I'm sorry that I had merge master and bring its change list into this PR

@codecov-io
Copy link

codecov-io commented Nov 15, 2019

Codecov Report

Merging #255 into develop will decrease coverage by 0.79%.
The diff coverage is 70.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##           develop     #255     +/-   ##
==========================================
- Coverage    66.24%   65.45%   -0.8%     
==========================================
  Files          108      111      +3     
  Lines         6903     7043    +140     
==========================================
+ Hits          4573     4610     +37     
- Misses        1879     1978     +99     
- Partials       451      455      +4
Impacted Files Coverage Δ
remoting/etcdv3/facade.go 0% <ø> (ø) ⬆️
remoting/etcdv3/listener.go 46.08% <ø> (ø) ⬆️
registry/etcdv3/listener.go 76.74% <ø> (ø) ⬆️
remoting/etcdv3/client.go 57.8% <ø> (ø) ⬆️
config/consumer_config.go 59.25% <ø> (ø) ⬆️
registry/etcdv3/registry.go 51.51% <ø> (ø) ⬆️
config/provider_config.go 58.53% <ø> (ø) ⬆️
registry/nacos/listener.go 80% <ø> (ø) ⬆️
registry/nacos/registry.go 61.78% <ø> (ø) ⬆️
registry/zookeeper/listener.go 61.7% <0%> (ø) ⬆️
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 52cce96...d7b5f50. Read the comment docs.

config/graceful_shutdown.go Outdated Show resolved Hide resolved
config/graceful_shutdown.go Outdated Show resolved Hide resolved
config/graceful_shutdown_config.go Outdated Show resolved Hide resolved
config/graceful_shutdown_config.go Outdated Show resolved Hide resolved
config/graceful_shutdown_test.go Outdated Show resolved Hide resolved
config/graceful_shutdown_test.go Outdated Show resolved Hide resolved
filter/impl/graceful_shutdown_filter.go Outdated Show resolved Hide resolved
filter/impl/graceful_shutdown_filter_test.go Show resolved Hide resolved
filter/impl/graceful_shutdown_filter_test.go Show resolved Hide resolved
config/graceful_shutdown_config_test.go Show resolved Hide resolved
config/graceful_shutdown.go Outdated Show resolved Hide resolved
config/graceful_shutdown.go Outdated Show resolved Hide resolved
config/graceful_shutdown.go Outdated Show resolved Hide resolved
config/graceful_shutdown_config.go Show resolved Hide resolved
config/graceful_shutdown_test.go Show resolved Hide resolved
@flycash
Copy link
Member Author

flycash commented Nov 22, 2019

All comments had been fixed and I've tested it end to end again.

Copy link
Contributor

@fangyincheng fangyincheng left a comment

Choose a reason for hiding this comment

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

LGTM

@AlexStocks
Copy link
Contributor

LGTM

Copy link
Contributor

@hxmhlt hxmhlt left a comment

Choose a reason for hiding this comment

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

LGTM

@hxmhlt hxmhlt merged commit 4f25df1 into apache:develop Nov 23, 2019
@pantianying
Copy link
Member

LGTM

@flycash flycash deleted the feature/GracefulExit branch January 10, 2020 14:28
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.

6 participants