From 499816f79c3273fc826c8cfb13a01a1a09445818 Mon Sep 17 00:00:00 2001 From: Ludovic Orban Date: Tue, 29 Aug 2023 11:16:40 +0200 Subject: [PATCH] #10226 fix HTTP consumeAvailable() buffer leak and re-enable tests Signed-off-by: Ludovic Orban --- .../org/eclipse/jetty/server/internal/HttpConnection.java | 1 + .../jetty/test/client/transport/ServerTimeoutsTest.java | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/internal/HttpConnection.java b/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/internal/HttpConnection.java index bda157c4030..0e585316b52 100644 --- a/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/internal/HttpConnection.java +++ b/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/internal/HttpConnection.java @@ -1146,6 +1146,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Writ Throwable result = HttpStream.consumeAvailable(this, getHttpConfiguration()); if (result != null) _generator.setPersistent(false); + releaseRequestBuffer(); return result; } diff --git a/jetty-core/jetty-tests/jetty-test-client-transports/src/test/java/org/eclipse/jetty/test/client/transport/ServerTimeoutsTest.java b/jetty-core/jetty-tests/jetty-test-client-transports/src/test/java/org/eclipse/jetty/test/client/transport/ServerTimeoutsTest.java index b80165c8b50..b6add791b31 100644 --- a/jetty-core/jetty-tests/jetty-test-client-transports/src/test/java/org/eclipse/jetty/test/client/transport/ServerTimeoutsTest.java +++ b/jetty-core/jetty-tests/jetty-test-client-transports/src/test/java/org/eclipse/jetty/test/client/transport/ServerTimeoutsTest.java @@ -32,7 +32,6 @@ import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Response; import org.eclipse.jetty.util.Callback; -import org.junit.jupiter.api.Tag; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -95,9 +94,6 @@ public class ServerTimeoutsTest extends AbstractTest @ParameterizedTest @MethodSource("transportsAndTrueIdleTimeoutListeners") - @Tag("DisableLeakTracking:server:HTTP") - @Tag("DisableLeakTracking:server:HTTPS") - @Tag("DisableLeakTracking:server:UNIX_DOMAIN") public void testIdleTimeoutWithDemand(Transport transport, boolean listener) throws Exception { AtomicBoolean listenerCalled = new AtomicBoolean();