This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new b473f54a10 Fix regression caused by the fix for BZ 69302
b473f54a10 is described below
commit b473f54a102cb4fbd93723b33fa66e43f56fb9a1
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Sep 13 16:27:56 2024 +0100
Fix regression caused by the fix for BZ 69302
---
java/org/apache/coyote/http2/StreamProcessor.java | 9 +++++++++
test/org/apache/coyote/http2/TestHttp2Section_5_1.java | 3 +--
webapps/docs/changelog.xml | 9 +++++++++
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java
b/java/org/apache/coyote/http2/StreamProcessor.java
index 78a676e271..6344e0f610 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -85,6 +85,15 @@ class StreamProcessor extends AbstractProcessor {
// Note: The regular processor uses the socketWrapper lock, but
using that here triggers a deadlock
processLock.lock();
try {
+ /*
+ * In some scenarios, error handling may trigger multiple
ERROR events for the same stream. The first
+ * ERROR event process will close the stream and recycle it.
Once the stream has been recycled it should
+ * not be used for processing any further events. The check
below ensures that this is the case. In
+ * particular, Stream.recycle() should not be called more than
once per Stream.
+ */
+ if (!stream.equals(handler.getStream(stream.getIdAsInt()))) {
+ return;
+ }
// HTTP/2 equivalent of AbstractConnectionHandler#process()
without the
// socket <-> processor mapping
SocketState state = SocketState.CLOSED;
diff --git a/test/org/apache/coyote/http2/TestHttp2Section_5_1.java
b/test/org/apache/coyote/http2/TestHttp2Section_5_1.java
index 312d5c97be..d72fb03efe 100644
--- a/test/org/apache/coyote/http2/TestHttp2Section_5_1.java
+++ b/test/org/apache/coyote/http2/TestHttp2Section_5_1.java
@@ -298,8 +298,7 @@ public class TestHttp2Section_5_1 extends Http2TestBase {
sendRst(3, Http2Error.NO_ERROR.getCode());
// Client reset triggers both a read error and a write error which in
turn trigger two server resets
parser.readFrame();
- parser.readFrame();
- Assert.assertEquals("3-RST-[5]\n3-RST-[5]\n", output.getTrace());
+ Assert.assertEquals("3-RST-[5]\n", output.getTrace());
output.clearTrace();
// Open up the connection window.
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4de3ee1a47..d78cd2861e 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,15 @@
issues do not "pop up" wrt. others).
-->
<section name="Tomcat 10.1.30 (schultz)" rtext="in development">
+ <subsection name="Coyote">
+ <changelog>
+ <fix>
+ Fix <bug>69320</bug>, a regression in the fix for <bug>69302</bug> that
+ meant the HTTP/2 processing was likely to be broken for all clients
once
+ any client sent an HTTP/2 reset frame. (markt)
+ </fix>
+ </changelog>
+ </subsection>
</section>
<section name="Tomcat 10.1.29 (schultz)" rtext="2024-09-10">
<subsection name="Catalina">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]