GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix #1994: log exceptions from IpcNamedLock.tryUnlock() by elharo · Pull Request #2045 · apache/maven-resolver

Conversation

@elharo

@elharo elharo commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #1994

IpcNamedLock.tryUnlock() was silently discarding all exceptions from client.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 mocks IpcClient so that lock() times out and unlock() throws, then asserts the unlock failure is logged. The test fails against the old code (no log output) and passes with the fix.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@elharo
Fix #1994: log exceptions from unlock() during timeout cleanup
57d2580
gnodet
gnodet approved these changes Aug 8, 2026
View reviewed changes

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. Test class visibility: IpcNamedLockTest is declared package-private while every other test class in the project uses public class. Consider adding public for consistency.

  2. stderr capture pattern: The test captures System.err to verify slf4j-simple output. This is pragmatic given the project's test dependencies, but worth noting it's not thread-safe for parallel test execution and depends on slf4j-simple default 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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread maven-resolver-named-locks-ipc/src/test/java/org/eclipse/aether/named/ipc/IpcNamedLockTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@elharo

elharo commented Aug 8, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@elharo

elharo commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

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:

DefaultRepositorySystemReentrancyTest.java:[361,17] incompatible types: no instance(s) of type variable(s) T exist so that java.util.List<T> conforms to java.util.Map<java.lang.String,org.eclipse.aether.spi.validator.ValidatorFactory>

introduced by commit f164aa9 Enh: Allow validator factory to abstain (#2008).

This PR only modifies the maven-resolver-named-locks-ipc module (IpcNamedLock + a regression test). All 27 unit tests + ITs for that module pass locally (-Prun-its verify), and spotless:check is green.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kwin

kwin commented Aug 8, 2026

Copy link
Copy Markdown
Member

Master has been fixed meanwhile. Can you rebase?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

elharo added 2 commits August 8, 2026 17:58
@elharo
retrigger checks
4eb1de7
@elharo
Merge branch 'master' into fix-1994-ipc-named-lock-unlock-log
3961c6a
@elharo
elharo merged commit 8b3b700 into master Aug 9, 2026
23 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@elharo
elharo deleted the fix-1994-ipc-named-lock-unlock-log branch August 9, 2026 11:15
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

@elharo Please assign appropriate label to PR according to the type of change.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot assigned elharo Aug 9, 2026
@github-actions github-actions Bot added this to the 2.0.22 milestone Aug 9, 2026
@cstamas cstamas added the enhancement New feature or request label Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gnodet gnodet gnodet approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@elharo elharo

Labels

enhancement New feature or request

Projects

None yet

Milestone

2.0.22

Development

Successfully merging this pull request may close these issues.

Empty catch swallows exceptions in IpcNamedLock.tryUnlock()

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@elharo @kwin @gnodet @cstamas
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.