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
The following commit(s) were added to refs/heads/9.0.x by this push:
new b99d75a Fix (hopefully) intermittently failing test
b99d75a is described below
commit b99d75ad6bd14bf7c8f868faae080e6693a02c10
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 307d2a9..df2ea10 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 5e5d69c..0e88b55 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>
<subsection name="Other">
@@ -12099,3 +12104,4 @@
</section>
</body>
</document>
+
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]