This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.0.x by this push:
new 6b13268 Fix (hopefully) intermittently failing test
6b13268 is described below
commit 6b1326870e0ae768cb8c4d51413c06e636ebbc9a
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Nov 29 17:09:45 2021 +0000
Fix (hopefully) intermittently failing test
---
java/org/apache/coyote/http2/Stream.java | 10 ++++++++--
webapps/docs/changelog.xml | 6 ++++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/coyote/http2/Stream.java
b/java/org/apache/coyote/http2/Stream.java
index cad1079..19f289b 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -655,8 +655,14 @@ class Stream extends AbstractNonZeroStream implements
HeaderEmitter {
log.debug(sm.getString("stream.reset.send",
getConnectionId(), getIdAsString(),
se.getError()));
}
- state.sendReset();
- handler.sendStreamReset(se);
+ // Sync ensures that if the call to sendReset() triggers resets
+ // in other threads, that the RST frame associated with this
+ // thread is sent before the RST frames associated with those
+ // threads.
+ synchronized (state) {
+ state.sendReset();
+ handler.sendStreamReset(se);
+ }
cancelAllocationRequests();
if (inputBuffer != null) {
inputBuffer.swallowUnread();
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4deeb0f..8ec7987 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -162,6 +162,11 @@
Refactor APR/native connector shutdown to remove a potential source of
JVM crashes on shutdown when sendfile is used. (markt)
</fix>
+ <fix>
+ When an error occurs that triggers a stream reset, ensure that the
first
+ <code>RST</code> frame sent to the client is the one associated with
the
+ error that triggered the reset. (markt)
+ </fix>
</changelog>
</subsection>
</section>
@@ -3300,3 +3305,4 @@
</section>
</body>
</document>
+
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]