Skip to content

Commit 684247a

Browse files
committed
Fix for inconsistent metadata was incomplete
Need to add key to map once created so it is visible to other threads
1 parent 6066fb5 commit 684247a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

java/org/apache/catalina/webresources/DirResourceSet.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ public ResourceLock lockForRead(String path) {
382382
resourceLock = resourceLocksByPath.get(key);
383383
if (resourceLock == null) {
384384
resourceLock = new ResourceLock(key);
385+
resourceLocksByPath.put(key, resourceLock);
385386
}
386387
resourceLock.count.incrementAndGet();
387388
}
@@ -419,6 +420,7 @@ public ResourceLock lockForWrite(String path) {
419420
resourceLock = resourceLocksByPath.get(key);
420421
if (resourceLock == null) {
421422
resourceLock = new ResourceLock(key);
423+
resourceLocksByPath.put(key, resourceLock);
422424
}
423425
resourceLock.count.incrementAndGet();
424426
}

webapps/docs/changelog.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@
128128
constructors or property related methods throw a checked exception.
129129
(remm)
130130
</fix>
131+
<fix>
132+
The previous fix for incosistent resource metadata during concurrent
133+
reads and writes was incomplete. (markt)
134+
</fix>
131135
</changelog>
132136
</subsection>
133137
<subsection name="Coyote">

0 commit comments

Comments
 (0)