-
Notifications
You must be signed in to change notification settings - Fork 94
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
Make threads daemons #988
Comments
@carrino why not just revive that PR you linked and continue the discussion there? The one case undesirable case I can think of is if a dying server wanted to kick off some kind of POST request, e.g. to ship some diagnostics somewhere or release some resources, a request might exist only on the Okhttp Dispatcher threads, which if they were daemon, would then just be dropped... Other than that, it sounds like a reasonable safe change that shouldn't hurt Foundry services... |
This sounds reasonable to me, I imagine our services are taking longer than necessary to stop while they wait the full timeout for idle threads to go away. |
I think the case you laid out isn't really useful in practice. I think if I call post, i would wait for the result to ensure it's complete and not rely on the implementation detail that we are using threads under the covers. |
In practice it could be helpful, you would enqueue an action which triggers a callback. If you're not blocking on a future, the application could exit. The problem is the daemon threads live a full minute while idle, and don't differentiate blocking shutdown between running vs idle. |
|
this never drops to 0 |
Would add https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html docs about immediate shutdown, in particular |
This issue has been automatically marked as stale because it has not been touched in the last 60 days. Please comment if you'd like to keep it open, otherwise it'll be closed in 7 days time. |
@carrino is this still important to you? I know we've built a bunch of bullet-proofing into Witchcraft so that shutdowns are guaranteed to finish within 2 minutes - perhaps that would help with your original use case? |
I thought we fixed this? |
Me too, but I don't have tests that prove it (or a use-case to really motivate spending time writing those tests). |
#792
Don't keep the jvm alive if everything else has shut down. This is producing a regression on one of our internal services that fails to start and never shuts down so doesn't get restarted and just hangs.
The text was updated successfully, but these errors were encountered: