This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit f7937bdea2987455f05bdee21b0f86b85aa93f34 Author: Mark Thomas <ma...@apache.org> AuthorDate: Thu Jan 25 12:20:14 2024 +0000 Make recycled streams eligible for GC immediately. Improves scalability. --- java/org/apache/coyote/http2/Http2UpgradeHandler.java | 2 +- java/org/apache/coyote/http2/Stream.java | 2 +- webapps/docs/changelog.xml | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java b/java/org/apache/coyote/http2/Http2UpgradeHandler.java index 533dc500b5..3e4768cf63 100644 --- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java +++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java @@ -87,7 +87,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH private static final String HTTP2_SETTINGS_HEADER = "HTTP2-Settings"; - private static final HeaderSink HEADER_SINK = new HeaderSink(); + protected static final HeaderSink HEADER_SINK = new HeaderSink(); protected final String connectionId; diff --git a/java/org/apache/coyote/http2/Stream.java b/java/org/apache/coyote/http2/Stream.java index 5fff907a41..d83e98f0bf 100644 --- a/java/org/apache/coyote/http2/Stream.java +++ b/java/org/apache/coyote/http2/Stream.java @@ -522,7 +522,7 @@ class Stream extends AbstractNonZeroStream implements HeaderEmitter { if (headerException == null) { return; } - + handler.getHpackDecoder().setHeaderEmitter(Http2UpgradeHandler.HEADER_SINK); throw headerException; } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index aa9d561731..dca3b91032 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -187,6 +187,11 @@ by reporting problems at the end of the frame where the error was detected rather than at the end of the headers. (markt) </fix> + <fix> + Remove the remaining reference to a stream once the stream has been + recycled. This makes the stream eligible for garbage collection earlier + and thereby improves scalability. (markt) + </fix> </changelog> </subsection> <subsection name="Jasper"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org