elharo opened a new pull request, #2032:
URL: https://github.com/apache/maven-resolver/pull/2032

   Closes #2030
   
   ## Problem
   
   org.eclipse.aether.named.ipc.IpcNamedLockFactoryIT.exclusiveAccess is flaky 
on Jenkins, timing out after 25 s with the main thread stuck in t1.join().
   
   The root cause is a deadlock in the Access handshake shared by sharedAccess, 
exclusiveAccess and mixedAccess. When both competing threads fail to acquire 
the lock within the 100 ms acquisition timeout, both threads count down the 
loser latch and then block forever on winner.await(), because the winners latch 
is never counted down. The test then hangs until the JUnit @Timeout fires.
   
   This happens under load when the in-process IPC server thread is starved for 
more than 100 ms, so neither acquisition completes in time. Earlier fixes only 
raised the overall test timeout (5 s to 15 s to 25 s), which converts the 
deadlock into a longer hang without fixing it.
   
   ## Fix
   
   - Raise the lock acquisition timeout in Access from 100 ms to 1 s so at 
least one thread reliably wins even on a loaded machine. Mutual exclusion is 
still verified: the loser is queued behind the winner on the server and cannot 
be granted while the winner holds, so its failure is still caused by the winner 
holding the lock.
   - Bound the winner/loser handshake awaits and the test-side joins and latch 
awaits, and assert the expected outcome. In the (now unlikely) case both 
threads lose, the test fails fast with a clear message instead of hanging for 
the full @Timeout.
   
   Verified by running IpcNamedLockFactoryIT 21 consecutive times (15 normal + 
6 under simulated CPU load), all passing.


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