abdulhannansyed548-cmd commented on PR #13522:
URL: https://github.com/apache/maven/pull/13522#issuecomment-6482935000

   In `DefaultMavenCache.clear()`, the values are snapshotted before 
`map.clear()` is called. If another thread inserts an entry after the snapshot 
but before the clear, that entry can be removed from the map without its 
`invalidate()` method being called. This is particularly concerning for cache 
records that own resources such as class realms.
   
   Could we make `clear()` coordinate with concurrent mutations, or otherwise 
ensure that every entry removed by `clear()` is invalidated? The 
`MavenCache.clear()` contract states that all removed entries must have 
`invalidate()` called, and the implementation documents that all operations are 
thread-safe.


-- 
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