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 — [1.9.x] Fix listener error swallowing (#1990), SyncContext double-close (#1992), and test flakiness (#1350) by slachiewicz · Pull Request #2109 · apache/maven-resolver

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Sep 1, 2026

Copy link
Copy Markdown
Member

Backport of #1990, #1992, and #1350 to the maven-resolver-1.9.x maintenance line.

Summary of Fixes

  1. #1990: ChainedRepositoryListener and ChainedTransferListener log exceptions from listeners at WARNING level in handleError() instead of silently swallowing them. Added unit tests verifying that an exception in one listener does not disrupt delivery to subsequent listeners in the multicast chain.
  2. #1992: Refactored DefaultArtifactResolver and DefaultMetadataResolver to eliminate redundant internal/finally SyncContext.close() calls, ensuring SyncContext instances are closed strictly once. Added unit test testSyncContextIsClosedExactlyOnce verifying single-close lifecycle.
  3. #1350 ([MRESOLVER-674]): Seeded Random in GenericVersionTest.testCompareUuidRandom with a fixed seed to ensure deterministic, reproducible test runs across Java 8 CI environments.

Sorry, something went wrong.

Uh oh!

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

All reactions
@slachiewicz
[1.9.x] Fix listener error swallowing (apache#1990), SyncContext doub…
bb1584e
…le-close (apache#1992), and test flakiness (apache#1350)

- apache#1990: Log listener exceptions in ChainedRepositoryListener and ChainedTransferListener; add unit tests for multicast resilience.
- apache#1992: Prevent SyncContext double-close in DefaultArtifactResolver and DefaultMetadataResolver; add verification test.
- apache#1350: Derandomize GenericVersionTest.testCompareUuidRandom with fixed seed.
@slachiewicz slachiewicz added bug Something isn't working maintenance labels Sep 1, 2026
@slachiewicz slachiewicz added this to the 1.9.28 milestone Sep 1, 2026
slachiewicz added 3 commits September 2, 2026 00:53
@slachiewicz
Close the shared SyncContext when the exclusive one cannot be created
9f0243f
Review follow-up, same change as on master: the shared context was
created outside any try block, so a SyncContextFactory that throws while
creating the exclusive context leaked it. The request loop now runs
before either context is created, and the shared context is closed if
the exclusive one cannot be obtained. The shared-to-exclusive hand-over
reassigns before closing so a throwing close() cannot leave the shared
context to be closed twice. The lifecycle test uses distinct instances.
@slachiewicz
Clean up imports in listener classes and add SyncContext tests for De…
a50e53b
…faultMetadataResolver
@slachiewicz
Clean up imports in listener classes and add SyncContext tests for De…
c4ff36f
…faultMetadataResolver on 1.9.x
@slachiewicz
slachiewicz marked this pull request as ready for review September 4, 2026 11:58
gnodet
gnodet approved these changes Sep 4, 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 backport of three fixes (listener error swallowing, SyncContext double-close, test flakiness) to the 1.9.x branch. All critical review findings from master PR #2108 (resource leaks, misleading test) have been addressed.

SyncContext lifecycle correctness verified: All code paths correctly manage the shared→exclusive hand-over, and the nested try-finally ensures no leaks even under exception conditions.

Low-severity observations (non-blocking):

  • catch (RuntimeException e) in DefaultArtifactResolver and DefaultMetadataResolver won't catch Error subtypes — consistent with master, and unlikely to matter in practice.
  • FQN cast (java.io.File) null in ChainedTransferListenerTest — cosmetic nit, avoiding an import is fine.

Note: Master PR #2108 is still open (not yet merged). If it receives further review-driven changes, the two PRs could diverge — consider merging the master version first.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of Guillaume Nodet

Sorry, something went wrong.

Uh oh!

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

All reactions
@slachiewicz
slachiewicz merged commit aa2b48a into apache:maven-resolver-1.9.x Sep 4, 2026
17 checks passed

Uh oh!

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

@slachiewicz
slachiewicz deleted the backport-1.9.x-hygiene branch September 4, 2026 19:38
@github-actions github-actions Bot assigned slachiewicz Sep 4, 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

@slachiewicz slachiewicz

Labels

bug Something isn't working maintenance

Projects

None yet

Milestone

1.9.28

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

2 participants

@slachiewicz @gnodet
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.