This is an automated email from the ASF dual-hosted git repository.
markt-asf 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 053445a664 Only dispatch the error notification once when an HTTP/2
stream is reset
053445a664 is described below
commit 053445a6647718af34d57d1a38fc35a6e5f2831a
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Nov 27 09:58:27 2026 +0000
Only dispatch the error notification once when an HTTP/2 stream is reset
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
---
java/org/apache/coyote/http2/Stream.java | 6 ++++--
webapps/docs/changelog.xml | 5 +++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/coyote/http2/Stream.java
b/java/org/apache/coyote/http2/Stream.java
index 47d61b99ea..7c0bfcc1be 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -1486,6 +1486,7 @@ class Stream extends AbstractNonZeroStream implements
HeaderEmitter {
private volatile long readTimeoutExpiry;
private volatile boolean closed;
private volatile boolean resetReceived;
+ private volatile boolean resetErrorDispatched;
@SuppressWarnings("deprecation")
@Override
@@ -1742,9 +1743,10 @@ class Stream extends AbstractNonZeroStream implements
HeaderEmitter {
* StreamProcessor recycling the Stream. The use of recycledLock
ensures that an attempt is not made to
* notify the ReadListener after the Stream has been recycled.
*/
- if (!recycled) {
+ if (!recycled && !resetErrorDispatched) {
synchronized (recycledLock) {
- if (!recycled) {
+ if (!recycled && !resetErrorDispatched) {
+ resetErrorDispatched = true;
// Trigger ReadListener.onError()
getCoyoteRequest().setAttribute(RequestDispatcher.ERROR_EXCEPTION,
new
IOException(sm.getString("stream.clientResetRequest")));
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index c66eebec9f..ee7fcf9523 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -372,6 +372,11 @@
<fix>
Improve performance of String based URI normalization. (markt)
</fix>
+ <fix>
+ Ensure that, when a client resets an HTTP/2 stream, the error
+ notification for the request is only dispatched once, even if the reset
+ is processed more than once. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]