This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit a573d936cc390b09e4e2a37795761c0c3eac819e Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri May 10 10:21:31 2019 +0100 Fix concurrency issue that lead to intermittent h2 5.3 test failures --- java/org/apache/coyote/http2/Http2UpgradeHandler.java | 6 +++++- webapps/docs/changelog.xml | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java b/java/org/apache/coyote/http2/Http2UpgradeHandler.java index 213b884..c2cf4da 100644 --- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java +++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java @@ -812,7 +812,11 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH // Has this stream been granted an allocation // Note: If the stream in not in this Map then the // requested write has been fully allocated - int[] value = backLogStreams.get(stream); + int[] value; + // Ensure allocations made in other threads are visible + synchronized (this) { + value = backLogStreams.get(stream); + } if (value != null && value[1] == 0) { if (log.isDebugEnabled()) { log.debug(sm.getString("upgradeHandler.noAllocation", diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index a115137..a0d7616 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -60,7 +60,8 @@ this. (remm) </fix> <fix> - Filter out some cases of incorrect HTTP/2 connection timeout. (remm) + Fix concurrency issue that lean to incorrect HTTP/2 connection timeout. + (remm/markt) </fix> <fix> Avoid useless exception wrapping in async IO. (remm) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org