This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new 1ff438d16a Only dispatch the error notification once when an HTTP/2
stream is reset
1ff438d16a is described below
commit 1ff438d16aa494a836336737110524ac49a26e25
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 1cf61781d2..812d30647d 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -1388,6 +1388,7 @@ class Stream extends AbstractNonZeroStream implements
HeaderEmitter {
private volatile long readTimeoutExpiry;
private volatile boolean closed;
private volatile boolean resetReceived;
+ private volatile boolean resetErrorDispatched;
@Override
public final int doRead(ApplicationBufferHandler
applicationBufferHandler) throws IOException {
@@ -1643,9 +1644,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 e6bd9a8777..ccb7ef0d56 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]