Skip to content

Improve ssl buffers handling#8165

Merged
sbordet merged 6 commits intojetty-10.0.xfrom
jetty-10.0.x-8161-ssl-buffers-handling
Jun 15, 2022
Merged

Improve ssl buffers handling#8165
sbordet merged 6 commits intojetty-10.0.xfrom
jetty-10.0.x-8161-ssl-buffers-handling

Conversation

@lorban
Copy link
Copy Markdown
Contributor

@lorban lorban commented Jun 14, 2022

Solves #8161

lorban added 3 commits June 14, 2022 17:51
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
@lorban lorban requested review from gregw, joakime and sbordet June 14, 2022 15:53
@lorban lorban self-assigned this Jun 14, 2022
@lorban lorban added the Sponsored This issue affects a user with a commercial support agreement label Jun 14, 2022
Copy link
Copy Markdown
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

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

I don't like the "clear to force a release later" pattern. Instead just have clearly named methods that release if empty vs always releases:

  • releaseEmptyInputBuffers; releaseInputBuffers
  • releaseInputBuffersIfEmpty; clearAndReleaseInputBuffers

But ultimately, we should not need comments like "clearing so a later release will take effect". Instead we should just release immediately in those locations - the subsequent final releases are already null check protected.

Comment thread jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java Outdated
Comment thread jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java Outdated
Comment thread jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java Outdated
Copy link
Copy Markdown
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.

I agree with @gregw comments about having a discard*Buffer that does both clearing and releasing.

Comment thread jetty-server/src/main/config/modules/retainablebytebufferpool.mod Outdated
Comment thread jetty-server/src/main/config/modules/retainablebytebufferpool.mod Outdated
Comment thread jetty-server/src/main/config/modules/retainablebytebufferpool.mod Outdated
lorban added 2 commits June 15, 2022 09:39
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
@lorban lorban requested review from gregw and sbordet June 15, 2022 07:41
gregw
gregw previously approved these changes Jun 15, 2022
Copy link
Copy Markdown
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
@sbordet sbordet merged commit 66de7ba into jetty-10.0.x Jun 15, 2022
@sbordet sbordet deleted the jetty-10.0.x-8161-ssl-buffers-handling branch June 15, 2022 13:10
@macfarla macfarla mentioned this pull request Jun 22, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Sponsored This issue affects a user with a commercial support agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants