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

Jetty 10: backport the tracking retainable pool from 12 #12041

Merged
merged 18 commits into from
Jul 18, 2024

Conversation

lorban
Copy link
Contributor

@lorban lorban commented Jul 15, 2024

Since Jetty 10's retainable pool is not resistant to leaks, we should change the default to a leak-resistant one. its been decided to not do that

Also backport the retainable buffer tracking pool from 12 as it is invaluable tracking down retained buffer leaks.

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
@lorban lorban added Enhancement Sponsored This issue affects a user with a commercial support agreement labels Jul 15, 2024
@lorban lorban requested review from gregw and sbordet July 15, 2024 10:43
@lorban lorban self-assigned this Jul 15, 2024
…ry in the Tracking pool to use a retaining variant

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
joakime
joakime previously approved these changes Jul 15, 2024
Copy link
Contributor

@joakime joakime left a comment

Choose a reason for hiding this comment

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

Looking good.
Just a bit concerned about the change in default behavior on one of the Constructors for LogarithmicArrayByteBufferPool

@@ -65,7 +65,7 @@ public LogarithmicArrayByteBufferPool(int minCapacity, int maxCapacity, int maxQ
*/
public LogarithmicArrayByteBufferPool(int minCapacity, int maxCapacity, int maxQueueLength, long maxHeapMemory, long maxDirectMemory)
{
this(minCapacity, maxCapacity, maxQueueLength, maxHeapMemory, maxDirectMemory, maxHeapMemory, maxDirectMemory);
this(minCapacity, maxCapacity, maxQueueLength, maxHeapMemory, maxDirectMemory, -2, -2);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to document this change in defaults?

Copy link
Contributor Author

@lorban lorban Jul 16, 2024

Choose a reason for hiding this comment

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

I would say yes, the release notes should indicate that a change in our default pool may have an impact on performance.

You've put your finger on the most sensible part of this PR that we should discuss: what do we want to do for 10/11 in the future with potential buffer leaks? Our options are:

  • change the default to use the less performant pool that is leak-resistant (what this change does)
  • backport the fast and leak resistant retainable pool from 12 (not a trivial job)
  • do nothing (which means spending time tracking reported leaks in releases that are in maintenance mode)

I'm in favor of the 1st option with the following justification: this will minimize the maintenance work of 10/11, the drop in perf is minimal enough that it's only going to affect a small fraction of the user base, it's easy to change your config to revert to the max-perf retainable pool, and upgrading to 12 will give you back the lost perf.

@sbordet @gregw @janbartel WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm in favour of option 3. Let's not change behaviour significantly in a dot release.
So restore the behaviour here but document the configuration changes needed to get the no retained memory behaviour.

sbordet
sbordet previously approved these changes Jul 16, 2024
gregw
gregw previously requested changes Jul 17, 2024
@@ -65,7 +65,7 @@ public LogarithmicArrayByteBufferPool(int minCapacity, int maxCapacity, int maxQ
*/
public LogarithmicArrayByteBufferPool(int minCapacity, int maxCapacity, int maxQueueLength, long maxHeapMemory, long maxDirectMemory)
{
this(minCapacity, maxCapacity, maxQueueLength, maxHeapMemory, maxDirectMemory, maxHeapMemory, maxDirectMemory);
this(minCapacity, maxCapacity, maxQueueLength, maxHeapMemory, maxDirectMemory, -2, -2);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm in favour of option 3. Let's not change behaviour significantly in a dot release.
So restore the behaviour here but document the configuration changes needed to get the no retained memory behaviour.

This reverts commit e2f899e.
This reverts commit b317f28.
This reverts commit 21d8903.
This reverts commit 926544c.
This reverts commit 5b9fdd8.
…rectMemory in the Tracking pool to use a retaining variant"

This reverts commit ee4b274.
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
@lorban lorban dismissed stale reviews from sbordet and joakime via 9d5ceb9 July 17, 2024 09:51
@lorban lorban requested review from gregw and joakime July 17, 2024 09:56
@lorban lorban requested a review from sbordet July 17, 2024 09:56
@lorban
Copy link
Contributor Author

lorban commented Jul 17, 2024

Alright, so we're going with only adding the tracking pool, and not changing the default retainable pool type.

@lorban lorban changed the title Jetty 10: backport the tracking pool and change default retaining pool to non-retaining Jetty 10: backport the tracking retainable pool from 12 Jul 17, 2024
@lorban lorban merged commit 92eecc1 into jetty-10.0.x Jul 18, 2024
11 checks passed
@lorban lorban deleted the fix/jetty-10.0.x/retainable-pools branch July 18, 2024 14:49
lorban added a commit that referenced this pull request Aug 6, 2024
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
lorban added a commit that referenced this pull request Aug 6, 2024
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
lorban added a commit that referenced this pull request Aug 7, 2024
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
@olamy olamy mentioned this pull request Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Sponsored This issue affects a user with a commercial support agreement
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

4 participants