http4s / blaze

Blazing fast NIO microframework and Http Parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Non-daemon threads currently preventing JVM termination

DGolubets opened this issue · comments

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

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.

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

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

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