-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
set threads to daemon as per #759 #760
Conversation
NetflixOSS » Hystrix » Hystrix-pull-requests #100 SUCCESS |
NetflixOSS » Hystrix » Hystrix-pull-requests #101 SUCCESS |
Thanks for the contribution, @cplee . Just to be clear about what this does, this should only change the behavior at JVM shutdown, correct? In current releases, Hystrix threads need to be explicitly killed and your change would allow the JVM to do the killing. Did I summarize that properly? |
@mattrjacobs Yes, the only change in behavior should be at JVM shutdown. Per the javadoc, "The Java Virtual Machine exits when the only threads running are all daemon threads." I suppose a concern may be that on JVM shutdown, these threads would be stopped abruptly. Maybe this behavior should be configurable? |
I only have experience in an environment where we never attempt graceful shutdown, so we're used to threads stopping abruptly. I guess the concern here would be things like I/O writes being in an incomplete state and now getting killed without being allowed to come to a natural end. I also took a closer look and, in practice, we are using a custom concurrency plugin at Netflix in production to set all threads to be daemon threads already - we just never changed this to be the default in open-source Hystrix. /cc @benjchristensen Any history on this that you can recall? |
I believe there were other things that prevented a clean shutdown which is why the Hystrix.reset() API was added but I can't remember. It won't hurt anything to have the threads be daemons. |
@benjchristensen Thanks for the confirmation. @cplee Merging now. |
set threads to daemon as per #759
No description provided.