Skip to content

Conversation

@lachlan-roberts
Copy link
Contributor

fixes #13029

This prevents the inflater/deflater from holding a reference to the frames buffer when it is fully consumed and awaiting the next frame/message.

I could not find a way to write a test case for this, but tested manually by accessing the DeflaterPool, getting the Deflater used by the websocket session, and using reflection to view its internal buffer.

Copy link
Contributor

@sbordet sbordet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lachlan-roberts the fix looks good, but the OP reported that the byte[] also had a reference from PerMessageDeflateExtension.OutgoingFlusher._frame.

I don't see that reference being cleared after the write, so I think we still have that problem.

In general, I think all the outgoing flushers should be reviewed to clear the fields they use for the writes.

@lachlan-roberts lachlan-roberts moved this to 🏗 In progress in Jetty 12.0.20 - FROZEN Apr 23, 2025
@lachlan-roberts lachlan-roberts self-assigned this Apr 23, 2025
@sbordet sbordet moved this from 🏗 In progress to 👀 In review in Jetty 12.0.20 - FROZEN Apr 23, 2025
@lachlan-roberts lachlan-roberts requested a review from sbordet April 24, 2025 03:59
@lachlan-roberts lachlan-roberts merged commit e2f3857 into jetty-12.0.x Apr 28, 2025
10 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Jetty 12.0.20 - FROZEN Apr 28, 2025
@lachlan-roberts lachlan-roberts deleted the fix/13029/jetty-12.0.x/permessage-deflate branch April 28, 2025 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Web-socket that use permessage-deflate extensions are keeping in memory the last message sent to the client

3 participants