-
Notifications
You must be signed in to change notification settings - Fork 8k
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
[feature request] make sentinel client close resources more easier and elegant #2178
Comments
It seems that infinite loops Lines 184 to 209 in 2c12b07
prevents JVM to stop. |
Maybe we can change those thread to daemon thread? Change Line 60 in 2c12b07
to new NamedThreadFactory("sentinel-command-center-executor", true)); Line 78 in 2c12b07
to new NamedThreadFactory("sentinel-command-center-service-executor", true), That will let jvm close when user thread finished. |
Good idea. Fancy a PR to improve it? |
please assign to me for practicing PR ~~~~(>_<)~~~~ |
Issue Description
Type: feature request
Describe what happened (or what feature you want)
User can close sentinel client's resouces manually.
Describe what you expected to happen
User can use
com.alibaba.csp.sentinel.init.InitExecutor.doInit()
to init sentinel client.Sometimes user want to close all resources in it.
Because some InitFunc will start a thread executor, and user may don't know how to close them.
For example, if user use
sentinel-transport-simple-http
,com.alibaba.csp.sentinel.transport.init.CommandCenterInitFunc
will usecom.alibaba.csp.sentinel.transport.command.SimpleHttpCommandCenter
, there are 2ExecutorService
in it, user must write code to close itTo make it more easier, should sentinel's client support a method to do it?
Like
CloseExecutor.doClose()
.Tell us your environment
OS: Centos 7.8
Jdk: 8
Sentinel Version: 1.8.0
Anything else we need to know?
When someone use Spring Cloud Alibaba Sentinel,
shutdown in actuator endpoint would be not working.
The reason is that
ExecutorService
incom.alibaba.csp.sentinel.transport.command.SimpleHttpCommandCenter
prevents JVM to stop.The text was updated successfully, but these errors were encountered: