oehme commented on PR #1281:
URL: https://github.com/apache/maven-mvnd/pull/1281#issuecomment-2705073602

   Turns out the real issue was in the `tryLock` method, which just silently 
returned `null` when the file couldn't be locked. Also today I learned that 
`try-with-resources` will happily accept `null`, so this was never spotted. The 
end effect was that there was no concurrency control, all processes would 
access the file without coordination.
   
   I've added a process-based test and fixed the tryLock method so that it does 
the retry loop until it gets a non-null lock or the timer runs out.
   
   In fact, I could revert all the other changes, the tryLock turned out to be 
the only true issue. To me, DataInputStream/DataOutputStream seems more 
straightforward than the memory mapped buffer. Whatever you prefer.


-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to