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

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

commit 9773bc301097cab1ce51c263ede46927a553caf4
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Feb 10 20:58:10 2026 +0000

    Fix BZ 69870 - add drainTimeout to HTTP/2
---
 java/org/apache/coyote/http2/Http2Protocol.java | 10 +++++-----
 webapps/docs/changelog.xml                      |  7 +++++++
 webapps/docs/config/http2.xml                   | 12 ++++++++++++
 3 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2Protocol.java 
b/java/org/apache/coyote/http2/Http2Protocol.java
index e5de0493f4..e3330a4120 100644
--- a/java/org/apache/coyote/http2/Http2Protocol.java
+++ b/java/org/apache/coyote/http2/Http2Protocol.java
@@ -129,11 +129,11 @@ public class Http2Protocol implements UpgradeProtocol {
 
     /*
      * Additional time in nanoseconds between sending the first graceful 
GOAWAY (max stream id) and the final GOAWAY
-     * (last seen stream id). During this time the server will continue to 
process new streams on the connection.
-     * This is to mitigate the race of client-buffered/sent packets for new 
streams and the final GOAWAY (with last
-     * seen stream id). By default, Tomcat uses the last computed RTT for this 
interval, but the RTT might have
-     * fluctuated due to network or server load conditions, or the client 
(e.g. nghttp2) might have already buffered
-     * frames for opening new streams on a connection.
+     * (last seen stream id). During this time the server will continue to 
process new streams on the connection. This
+     * is to mitigate the race of client-buffered/sent packets for new streams 
and the final GOAWAY (with last seen
+     * stream id). By default, Tomcat uses the last computed RTT for this 
interval, but the RTT might have fluctuated
+     * due to network or server load conditions, or the client (e.g. nghttp2) 
might have already buffered frames for
+     * opening new streams on a connection.
      *
      * The name "drainTimeout" is taken from Envoy proxy's identical HTTP 
Connection Manager property and means exactly
      * the same.
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 84ec8dece2..55750f05cd 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -136,6 +136,13 @@
         <code>CBC</code>when setting the <code>ciphers</code> attribute of
         an <code>SSLHostConfig</code> element. (markt)
       </fix>
+      <add>
+        <bug>69870</bug>: Add a <code>drainTimeout</code> to the HTTP/2
+        <code>UpgradeProtocol</code> element to allow configuration of an
+        time between the two final <code>GOAWAY</code> frames sent by Tomcat
+        when closing am HTTP/2 connection. Pull request <pr>917</pr> provided 
by
+        Kai Burjack. (markt)
+      </add>
     </changelog>
   </subsection>
   <subsection name="Jasper">
diff --git a/webapps/docs/config/http2.xml b/webapps/docs/config/http2.xml
index b2329a4fdb..21551990a0 100644
--- a/webapps/docs/config/http2.xml
+++ b/webapps/docs/config/http2.xml
@@ -134,6 +134,18 @@
       If not specified, this attribute is set to <code>false</code>.</p>
     </attribute>
 
+    <attribute name="drainTimpout" required="false">
+      <p>Additional time in nanoseconds between sending the first graceful
+      GOAWAY (max stream id) and the final GOAWAY (last seen stream id). During
+      this time the server will continue to process new streams on the
+      connection. This is to mitigate the race of client-buffered/sent packets
+      for new streams and the final GOAWAY (with last seen stream id). By
+      default, Tomcat uses the last computed RTT for this interval, but the RTT
+      might have fluctuated due to network or server load conditions, or the
+      client might have already buffered frames for opening new streams on a
+      connection. If not specified, this attribute is set to 
<code>0</code>.</p>
+    </attribute>
+
     <attribute name="initialWindowSize" required="false">
       <p>Controls the initial size of the flow control window for streams that
       Tomcat advertises to clients. If not specified, the default value of


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to