cowwoc commented on code in PR #394:
URL: 
https://github.com/apache/maven-build-cache-extension/pull/394#discussion_r2423208867


##########
src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java:
##########
@@ -498,25 +498,23 @@ public void save(
         final MavenProject project = context.getProject();
         final MavenSession session = context.getSession();
         try {
+            attachedResourcesPathsById.clear();

Review Comment:
   You're right.
   
   I'll update the design to use per-project isolation using 
`ConcurrentHashMap<String, ConcurrentHashMap<String, Path>>`. Each project gets 
its own isolated map and counter, eliminating race conditions in multi-threaded 
builds.



##########
src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java:
##########
@@ -498,25 +498,23 @@ public void save(
         final MavenProject project = context.getProject();
         final MavenSession session = context.getSession();
         try {
+            attachedResourcesPathsById.clear();

Review Comment:
   You're right.
   
   I'll update the design to use per-project isolation using 
`ConcurrentHashMap<String, ConcurrentHashMap<String, Path>>`. Each project will 
get its own isolated map and counter, eliminating race conditions in 
multi-threaded builds.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to