This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 63ae2b5c0becc9a49ecf7f16daa3e24161a1c6a9
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 fbeda40486..7686ae057b 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -88,7 +88,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 eb548119f6..d09506dcc4 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -517,7 +517,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 beebcf6765..26a7cbd71b 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -170,6 +170,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

Reply via email to