Skip to content

Commit

Permalink
Fix for inconsistent metadata was incomplete
Browse files Browse the repository at this point in the history
Need to add key to map once created so it is visible to other threads
  • Loading branch information
markt-asf committed Nov 15, 2024
1 parent 6066fb5 commit 684247a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions java/org/apache/catalina/webresources/DirResourceSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ public ResourceLock lockForRead(String path) {
resourceLock = resourceLocksByPath.get(key);
if (resourceLock == null) {
resourceLock = new ResourceLock(key);
resourceLocksByPath.put(key, resourceLock);
}
resourceLock.count.incrementAndGet();
}
Expand Down Expand Up @@ -419,6 +420,7 @@ public ResourceLock lockForWrite(String path) {
resourceLock = resourceLocksByPath.get(key);
if (resourceLock == null) {
resourceLock = new ResourceLock(key);
resourceLocksByPath.put(key, resourceLock);
}
resourceLock.count.incrementAndGet();
}
Expand Down
4 changes: 4 additions & 0 deletions webapps/docs/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@
constructors or property related methods throw a checked exception.
(remm)
</fix>
<fix>
The previous fix for incosistent resource metadata during concurrent
reads and writes was incomplete. (markt)
</fix>
</changelog>
</subsection>
<subsection name="Coyote">
Expand Down

0 comments on commit 684247a

Please sign in to comment.