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 testPut_StartCancelled regression introduced by #2206 by gnodet · Pull Request #2219 · apache/maven-resolver

Conversation

@gnodet

@gnodet gnodet commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes a regression introduced by #2206: testPut_StartCancelled fails on macOS CI with "Expected error" because TransferCancelledException from the retroactive transportStarted() call is silently swallowed.

Root Cause

#2206 added a retroactive progress-event block that fires transportStarted/transportProgressed after a successful response, for macOS/Jetty configurations that skip onRequestContent callbacks. The block caught TransferCancelledException from transportStarted() and fell through silently:

} catch (TransferCancelledException e) {
    // upload already sent — retroactive notification cannot be cancelled;
    // fall through to transportPropertiesAvailable and status check
}

When a test listener has cancelStart() set, transportStarted() is supposed to throw and the caller (transporter.put()) must surface that exception. The catch-and-ignore broke this contract, causing the PUT to complete without error instead of throwing TransferCancelledException.

Fix

Remove the try/catch around the retroactive transportStarted() call. The exception propagates naturally — the fact that bytes were already sent does not authorise silencing a cancelStart cancellation.

The catch (TransferCancelledException e) { break; } inside the retroactive transportProgressed loop is kept as-is: it exits the loop (correct) and the status check still runs after.

Testing

  • testPut_StartCancelled now passes (was failing)
  • testPut_ProgressCancelled, testPut_ProxyAuthenticated, testPut_SSL continue to pass
  • Full JettyTransporterTest suite: 90 tests pass, 10 skipped (HTTP/3 infra), 0 failures

Hermes Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet

Sorry, something went wrong.

Uh oh!

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

All reactions
@gnodet @claude
Fix testPut_StartCancelled regression introduced by apache#2206
c0c1344
The retroactive progress-event block added in apache#2206 (to handle macOS
platforms where Jetty skips onRequestContent callbacks) incorrectly
swallowed TransferCancelledException thrown by transportStarted().

When a listener has cancelStart() set, transportStarted() must throw
and that exception must propagate to the caller — regardless of whether
the bytes have already been sent. Catching and silencing the exception
caused testPut_StartCancelled to pass through without error, breaking
the TransportListener cancellation contract.

Fix: remove the try/catch around the retroactive transportStarted() call
so the exception propagates naturally. The TransferCancelledException
from the retroactive transportProgressed() loop is still caught-and-broken
(correct: the loop exits, transportPropertiesAvailable and the status check
still run).

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
@cstamas
cstamas requested a balanced review from Copilot October 20, 2026 20:38
gnodet-bot
gnodet-bot approved these changes Oct 20, 2026
View reviewed changes

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

Correct fix — removes the erroneous try/catch that silently swallowed TransferCancelledException from the retroactive transportStarted() call. This restores contract consistency with AbstractTransporter.utilPut() where transportStarted() cancellation is expected to propagate uncaught.

The cancellation asymmetry (transportStarted propagates, transportProgressed breaks the upload loop) is intentional and correct. The updated comment // exit loop; fall through to transportPropertiesAvailable accurately describes the control flow. Resource safety is sound — the try-with-resources listener and implPut()'s throws Exception declaration ensure proper cleanup if transportStarted() cancels before the stream is opened.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

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

All reactions
Copilot AI reviewed Oct 20, 2026
View reviewed changes

Copilot AI 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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

No open issues 🎉

What changed in this PR

Fixes a regression where TransferCancelledException thrown by a retroactive transportStarted() call was being swallowed, causing testPut_StartCancelled to incorrectly pass through without surfacing cancellation.

Changes:

  • Remove the try/catch that ignored TransferCancelledException from retroactive transportStarted() so cancellation propagates to callers.
  • Clarify comments around retroactive progress event behavior and the intended control flow when progress cancellation occurs.
File Description
maven-resolver-transport-jetty/​src/​main/​java/​org/​eclipse/​aether/​transport/​jetty/​JettyTransporter.java Ensures cancelStart is observable by propagating TransferCancelledException from retroactive transportStarted() instead of swallowing it.

Review effort: Lite

Sorry, something went wrong.

Uh oh!

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

All reactions
cstamas
cstamas approved these changes Oct 20, 2026
View reviewed changes
@cstamas
cstamas requested a review from olamy October 20, 2026 21:09
@cstamas cstamas added this to the 2.0.25 milestone Oct 20, 2026
@cstamas cstamas added the bug Something isn't working label Oct 20, 2026
Copilot stopped reviewing on behalf of cstamas due to an error October 20, 2026 23:23
Workflow completed but conclusion is not available. This may indicate rate limiting or API issues.
@cstamas
cstamas merged commit b4634eb into apache:master Oct 21, 2026
22 checks passed

Uh oh!

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

@github-actions github-actions Bot assigned cstamas Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@cstamas cstamas cstamas approved these changes
@olamy olamy Awaiting requested review from olamy
+1 more reviewer
@gnodet-bot gnodet-bot gnodet-bot approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

@cstamas cstamas

Labels

bug Something isn't working

Projects

None yet

Milestone

2.0.25

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

4 participants

@gnodet @cstamas @gnodet-bot
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.