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

Graceful shutdowns for blaze-server #661

Open
RaasAhsan opened this issue Jan 8, 2021 · 3 comments
Open

Graceful shutdowns for blaze-server #661

RaasAhsan opened this issue Jan 8, 2021 · 3 comments

Comments

@RaasAhsan
Copy link

I'm unhappy about the allocated call we're making for the Dispatcher, so we should probably gauge feasibility for getting graceful shutdowns.

@RaasAhsan
Copy link
Author

So, I think this is going to be nontrivial at best. The problem is that the Dispatcher can be called on ExecutionContexts which are not necessarily bounded to the lifetime of the Dispatcher, which means that it can "go out of scope" and get leaked. This happens at least with IdleTimeoutStage and NIOHead1Stage.

Maybe we can add some kind of latch that shutdown can synchronize against which is released after there is no more selector activity

@yanns
Copy link
Contributor

yanns commented Jan 8, 2021

What do you think of http4s/http4s#4160 ? (only for the tests part)

@RaasAhsan
Copy link
Author

@yanns I wasn't descriptive enough in the issue, I was actually referring to an allocated in BlazeServerBuilder, which is necessary for reasons listed above. The allocated in tests is less concerning but it's a good idea to do that too!

@rossabaker rossabaker transferred this issue from http4s/http4s May 24, 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

3 participants