Skip to content

12.0.x: Issue #15941 - release Deflater after each message without context takeover - #15943

Merged
lachlan-roberts merged 1 commit into
jetty:jetty-12.0.xfrom
stefanroex:fix/15941/jetty-12.0.x/permessage-deflate-release
Oct 12, 2026
Merged

lachlan-roberts merged 1 commit into
jetty:jetty-12.0.xfrom
stefanroex:fix/15941/jetty-12.0.x/permessage-deflate-release

Conversation

@stefanroex

Copy link
Copy Markdown
Contributor

Backport of #15942 to 12.0.x for issue #15941.

The code around the fix differs from 12.1.x, so this is a manual port rather than a cherry-pick. The test is the version requested in the 12.1.x review: AbstractExtensionTest starts and stops the shared WebSocketComponents around each test, and the new test asserts against its DeflaterPool.

…xt takeover

With server_no_context_takeover, the Deflater was released to the pool
after the final frame of a message, but clearing its input afterwards
acquired a new one from the pool. Every session kept holding a Deflater
(and its native zlib memory) between messages.

Only clear the input when the session still holds a Deflater. A
released Deflater is already reset by the pool.

Backport of jetty#15942 to jetty-12.0.x.

Signed-off-by: Stefan Roex <stefan@brightmotive.com>
@lachlan-roberts
lachlan-roberts merged commit 1c1de53 into jetty:jetty-12.0.x Oct 12, 2026
9 checks passed
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

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants