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

Don't block on cancellation in Http1ServerStage #5118

Merged
merged 2 commits into from Aug 29, 2021
Merged

Conversation

rossabaker
Copy link
Member

In Cats-Effect 3, cancellation applies backpressure on completion of the finalizer. If a response can't be canceled, the cancellation task does not complete. Beginning in http4s-0.23, we started running this cancellation token synchronously in Http1ServerStage. The result is that an uncancelable response can lock up the TickWheelExecutor's scheduler thread. Unhandled scheduled events may continue to pile up until OOM.

This runs cancellation asynchronously, as was done before http4s-0.23. The test demonstrates that scheduling continues even after the cancellation of an uncancelable request.

Fixes #5116.

@rossabaker rossabaker added bug Determined to be a bug in http4s module:blaze-server labels Aug 28, 2021
@rossabaker
Copy link
Member Author

Oh good I made another flaky Blaze test.

It went red-to-green, reliably, on my laptop.

@rossabaker rossabaker merged commit d1988cd into series/0.23 Aug 29, 2021
@rossabaker rossabaker deleted the issue-5116 branch August 29, 2021 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Determined to be a bug in http4s module:blaze-server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants