sakshichitnis27 commented on issue #11116:
URL: https://github.com/apache/maven/issues/11116#issuecomment-6470396688

   Hi! While looking at the `retry` question in this thread I think I found a 
separate problem in maven-resolver 1.9.x that may explain @delanym's report 
(retry set to 3, but only "Attempt 1" in the suppressed exceptions).
   
   In `NamedLockFactoryAdapter.acquire()` the exception list from failed 
attempts is checked at the end (`!illegalStateExceptions.isEmpty()`), so a lock 
acquired on a later attempt is still reported as a failure. I was able to 
reproduce this with Maven 3.9.11 by holding the file lock from another JVM for 
9s with `time=3` and `retry=3`: the build failed even though the lock was 
released before the last attempt. I couldn't find an existing issue or PR for 
this in maven-resolver after searching PRs/issues and checking this issue's 
timeline.
   
   I opened a small draft PR with a regression test against 
`maven-resolver-1.9.x`: https://github.com/apache/maven-resolver/pull/2240
   
   It doesn't change the lock timeout or the cause of slow lock acquisition 
discussed above, so it wouldn't close this issue on its own.
   


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