Repository navigation
Fix #1994: log exceptions from IpcNamedLock.tryUnlock() - #2045
Conversation
gnodet
left a comment
There was a problem hiding this comment.
Clean, minimal fix that adds WARN-level logging for a previously silent exception catch in IpcNamedLock.tryUnlock(). The production change is correct β a single logger.warn() call using the inherited SLF4J logger, with the exception passed for stack trace logging. WARN level is appropriate for a secondary failure during timeout cleanup.
Two minor style notes (non-blocking):
-
Test class visibility:
IpcNamedLockTestis declared package-private while every other test class in the project usespublic class. Consider addingpublicfor consistency. -
stderr capture pattern: The test captures
System.errto verifyslf4j-simpleoutput. This is pragmatic given the project's test dependencies, but worth noting it's not thread-safe for parallel test execution and depends onslf4j-simpledefault configuration.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
|
https://github.com/apache/maven-resolver/blob/89f2bc1b284e0024c3a4121f55dd0f4709d35009/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRepositorySystemReentrancyTest.java seems to have broken the CI and went in without a pull request. We really need to block this at the repo level. |
|
The Verify failures are pre-existing on master, not caused by this change. Master commit 89f2bc1 has the identical 18 failing Verify jobs (e.g. windows-latest jdk-21-zulu 4.0.0-rc-6 fails on the same lines). The failure is a test-compile error in the maven-resolver-impl module: introduced by commit f164aa9 This PR only modifies the |
|
Master has been fixed meanwhile. Can you rebase? |
|
@elharo Please assign appropriate label to PR according to the type of change. |
Fixes #1994
IpcNamedLock.tryUnlock()was silently discarding all exceptions fromclient.unlock()during timeout cleanup, masking real IO/connectivity issues.Fix: log the failure at WARN level instead of swallowing it. The exception is still not propagated, preserving the best-effort cleanup semantics that must not crash the calling thread.
Test: added
IpcNamedLockTest.unlockFailureDuringTimeoutCleanupIsLogged, which mocksIpcClientso thatlock()times out andunlock()throws, then asserts the unlock failure is logged. The test fails against the old code (no log output) and passes with the fix.