gnodet opened a new pull request, #1910: URL: https://github.com/apache/maven-resolver/pull/1910
## Summary Fixes Windows CI flakiness in `IpcNamedLockFactoryIT.exclusiveAccess()` (seen in PR #1909, CI run 27139141318). **Root cause**: When the loser thread's `client.lock()` times out in `doLockExclusively()`, the cleanup call `client.unlock(contextId)` could either: - **Hang forever** — it used `Long.MAX_VALUE` timeout, so if the server/receiver had any issue, the thread blocked indefinitely - **Throw RuntimeException** — which propagated out of `Access.run()` (which only catches `InterruptedException`), causing the thread to terminate without calling `loser.countDown()`. The winner thread then waited on `loser.await()` forever, and the test hung until Surefire killed it at 25 seconds. ## Changes 1. **`IpcNamedLock`**: Wrap cleanup unlock in `tryUnlock()` — a try-catch that swallows exceptions so the calling thread always returns `false` instead of crashing. This is the primary fix. 2. **`IpcClient.unlock()`**: Replace `Long.MAX_VALUE` timeout with 10 seconds. Normal unlock round-trips complete in microseconds; 10 seconds is generous enough while preventing infinite hangs. 3. **`IpcClient.stopServer()`**: Replace `Long.MAX_VALUE` timeout with 30 seconds. 4. **`IpcClient.receive()`**: On empty response, complete the future exceptionally instead of throwing `IllegalStateException` — the old behavior killed the receiver thread, breaking all subsequent operations on the shared client. 5. **`IpcClient.close()`**: Call `close()` on EOF so pending futures are properly cleaned up when the server disconnects, and reset the `initialized` flag to prevent stale state. ## Test plan - [x] All 27 IPC tests pass locally (unit + integration: `IpcNamedLockFactoryIT`, `IpcAdapterNoForkIT`, `IpcAdapterIT`) - [ ] Windows CI should no longer hang on `exclusiveAccess` -- 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]
