GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Fix flaky JettyTransporterTest progress events on macOS by gnodet · Pull Request #2206 · apache/maven-resolver Conversation
Contributor
SummaryFixes the flaky Root Cause
This is a platform-specific timing issue in Jetty's HTTP/2 send pipeline — on Linux and Windows, the callback fires reliably; on macOS (kqueue-based IO), the write completes without the intermediate notification. FixAfter a successful PUT request completes, check whether any
The fix is minimal (16 lines added) and does not change behavior when Testing
Hermes Agent (Claude Opus 4) on behalf of Guillaume Nodet
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsThe onRequestContent callback in Jetty's async pipeline may not fire for small PUT requests on macOS with proxy authentication or TLS/HTTP2, leaving progressedCount at 0 even though the upload succeeds. This is because Jetty can coalesce the request content with headers in its HTTP/2 send pipeline, bypassing the per-chunk callback notification. After a successful PUT, if no progress event was reported via the onRequestContent callback, fire transportStarted/transportProgressed retroactively using the task's data. This ensures the progress listener is always informed of completed uploads regardless of Jetty's internal callback timing. Fix apache#2203 Co-authored-by: Claude Opus 4 <[email protected]>
gnodet-bot
reviewed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reviewed the retroactive progress-event path added to fix the macOS flakiness. The logic is correct and well-contained behind the One low-severity memory observation below. 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 reactionsUh oh!
There was an error while loading. Please reload this page.
gnodet-bot
reviewed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previous finding (memory concern with 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 reactionsUh oh!
There was an error while loading. Please reload this page. The retroactive transportStarted/transportProgressed block runs after the server returned 2xx, so the upload has already succeeded. If a listener throws TransferCancelledException here, the caller sees an exception from implPut() and may retry a PUT that already landed. Catch and discard TCE in both calls: for transportStarted(), return early (no point continuing notification); for transportProgressed(), break out of the loop (same reasoning).
gnodet-bot
reviewed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Re-review after commit 3 (Guard retroactive progress path against TransferCancelledException) Previous findings addressed:
Two new observations below. One inline (ordering) and one general (test coverage). Missing dedicated test for the retroactive path: The existing tests 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 reactionsUh oh!
There was an error while loading. Please reload this page.
gnodet-bot
suggested changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Error-path regression: The move of Before this PR: response = listener.get(requestTimeout, TimeUnit.MILLISECONDS); task.getListener().transportPropertiesAvailable(...); // ← called unconditionally if (response.getStatus() >= MULTIPLE_CHOICES) { JettyRFC9457Reporter.INSTANCE.generateException(...); // throws } After this PR: response = listener.get(requestTimeout, TimeUnit.MILLISECONDS); if (response.getStatus() >= MULTIPLE_CHOICES) { JettyRFC9457Reporter.INSTANCE.generateException(...); // throws — skips everything below } // ... retroactive progress block ... task.getListener().transportPropertiesAvailable(...); // ← unreachable on 3xx/4xx/5xx For error responses (status ≥ 300), Fix: move if (task.getDataLength() > 0 && !progressed.get()) { // ... retroactive transportStarted/transportProgressed ... } // transportPropertiesAvailable goes here — BEFORE the status check task.getListener().transportPropertiesAvailable(createTransportProperties(request, rawResponseHeaders)); if (response.getStatus() >= MULTIPLE_CHOICES) { JettyRFC9457Reporter.INSTANCE.generateException(...); } 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 reactionsUh oh!
There was an error while loading. Please reload this page. Move transportPropertiesAvailable before the status check so it is reachable on both success (2xx) and error (3xx/4xx/5xx) responses. Previously, generateException() threw HttpTransporterException for error responses, exiting the try block before reaching transportPropertiesAvailable — a regression from the original behavior. Also move the retroactive progress block before the status check so the listener ordering contract (transportPropertiesAvailable after transportStarted) is maintained regardless of response status.
gnodet-bot
suggested changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Re-review after commit 5 (restore Previous REQUEST_CHANGES finding addressed:
One new concern introduced by this commit: moving the retroactive progress block before the status check exposes a silent-failure path that didn't exist before. 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 reactionsUh oh!
There was an error while loading. Please reload this page. …s block When the retroactive progress block runs before the status check (as of commit 5), catching TransferCancelledException with 'return' exits implPut() without calling generateException — silently swallowing error responses (3xx/4xx/5xx). Replace 'return' with a fall-through so the status check is always reached regardless of TCE.
gnodet-bot
approved these changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Re-review after commit 6 (fall through status check when TCE thrown in retroactive progress block) Previous REQUEST_CHANGES finding addressed:
All prior findings across 6 commits are now resolved. The fix is correct and well-layered:
The one outstanding observation (no CI-deterministic test for the retroactive path, since macOS-specific) remains — but it was raised as a COMMENT in review 3, not a blocker, and is noted for future reference. LGTM. 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
cstamas
approved these changes
Uh oh!
There was an error while loading. Please reload this page.
cstamas
pushed a commit
that referenced
this pull request
## 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: ```java } 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_
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reviewers+1 more reviewerUh oh!
There was an error while loading. Please reload this page. AssigneesLabelsProjectsDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. |