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

Fix NPE when GzipHandler is writing and an exception is thrown by the wrapping's Response.write() #12025

Merged

Conversation

lorban
Copy link
Contributor

@lorban lorban commented Jul 10, 2024

GzipBufferCB does not set the GZState to FINISHED when it fails, which leaves the code trying to finish up gzipping while everything has already been cleaned up.

Fixes #12022

… by the wrapping's Response.write()

Signed-off-by: Ludovic Orban <[email protected]>
@lorban lorban added the Bug For general bugs on Jetty side label Jul 10, 2024
@lorban lorban requested review from gregw and sbordet July 10, 2024 10:16
@lorban lorban self-assigned this Jul 10, 2024
Signed-off-by: Ludovic Orban <[email protected]>
@lorban lorban requested review from gregw and sbordet July 11, 2024 16:30
@gregw
Copy link
Contributor

gregw commented Jul 12, 2024

@lorban something looks broken in this now.

sbordet
sbordet previously approved these changes Jul 12, 2024
Signed-off-by: Ludovic Orban <[email protected]>
@lorban
Copy link
Contributor Author

lorban commented Jul 12, 2024

I've reverted most of the suggested cleanups because they break the logic in subtle ways: cleanup cannot be called from onCompleteSuccess and the RBB cannot be scoped at the GzipBufferCB level because the data in the buffer's lifecycle is longer than the callback's lifecycle.

@lorban lorban requested a review from sbordet July 12, 2024 09:16
@lorban lorban dismissed gregw’s stale review July 16, 2024 13:37

This has been addressed.

@lorban lorban merged commit 964c2ea into jetty-12.0.x Jul 16, 2024
10 checks passed
@lorban lorban deleted the fix/jetty-12.0.x/12022-npe-in-GzipHandler-write-failure branch July 16, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Intermittent NPE in OutputStream.close with GzipHandler
3 participants