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

Non-daemon threads currently preventing JVM termination #722

Open
DGolubets opened this issue Feb 23, 2022 · 4 comments
Open

Non-daemon threads currently preventing JVM termination #722

DGolubets opened this issue Feb 23, 2022 · 4 comments

Comments

@DGolubets
Copy link

Sometimes I see my apps not shutting down properly with this in the output:

Non-daemon threads currently preventing JVM termination: - 45: Thread[DestroyJavaVM,5,main]
 -  - 21: Thread[blaze-selector-0,5,main]

I can't easily reproduce this.
But my question is: why do you make these threads non-daemon? Any particular reason?

Http4s version: 0.23.7

@rossabaker rossabaker transferred this issue from http4s/http4s Mar 13, 2022
@rossabaker
Copy link
Member

That decision was probably made a long time ago, but I think the idea was that in-flight work could still be happening on these threads, so we wanted them to drain before shutting down. Unfortunately, blaze still doesn't have a graceful shutdown (#59), so keeping these threads around really doesn't help anything. And modern cats-effect thinking is to sequence everything into the main IO. I would not be opposed to changing this.

@rossabaker
Copy link
Member

Oops. I shouldn't have transferred this. Those threads are created in http4s, not in blaze.

@rossabaker rossabaker transferred this issue from http4s/blaze Mar 13, 2022
@dzanot
Copy link

dzanot commented Jul 28, 2022

Transferring the issue broke your link in the previous comment, should be this 59: #59

@armanbilge
Copy link
Member

Actually I think this should be transferred back to the blaze repo 😅 all blaze dev happens there now.

@rossabaker rossabaker transferred this issue from http4s/http4s Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants