Repository navigation
Conversation
|
Review findings, most significant first. I read the diff and surrounding code only and did not run the tests.
|
|
Re-review of the follow-up commit. I read the diff and surrounding code only and did not run the tests. The earlier items are addressed, except the test-teardown NPE in item 7. The commits are identical on master and 2.x apart from the Jackson import, so this applies to both PRs.
|
|
Third-round review of the latest commit (03ef782 on master, 441ec6f on 2.x). I read the diff and surrounding code only and did not run the tests. The earlier items are addressed: the shared
|
|
Fourth-round review of the latest commit (45cba7f on master, 7b9e022 on 2.x). I read the diff and the Undertow sources only and did not run the tests. The general
|
|
Fifth-round review of the latest commit (3efe64e on master, b814e36 on 2.x). I read the diff only and did not run the tests. The merge of master brings in #2834 but does not interact with this code, because
|
|
Review of the current heads (3efe64e on master, b814e36 on 2.x) with the SonarCloud result. These are the same commits as the previous round, so the code findings carry over. I read the diff and SonarCloud's public API only and did not run the tests. The two PRs are identical apart from README line numbers. The failing "SonarCloud Code Analysis" check comes from one rule. java:S2445 is flagged at Still open from the previous round:
New this round, from Sonar, not gate-failing:
|
Code review — round 7 (heads 79301b4 / e59abff)The two PRs carry the same change apart from README line numbers. 14 findings, most severe first. Correctness
Tests Cleanup SonarCloud passes on both PRs (0 bugs). Both PRs remain drafts. |
Code review — round 8 (heads 4df4bf6 / 139bcf8)The two branches carry the same change. The only difference in the new commits is the machine-specific numbers in This patch resolves most earlier findings:
9 findings remain, most severe first. Correctness
Cleanup Tests |
Code review — round 9 (heads 2b2788d / fe1ea0f)The two branches carry the same change apart from the numbers in the deleted benchmark files. CI. Fixed since round 8:
10 findings remain, most severe first. Correctness
Performance Cleanup Tests |
Code review — round 10 (heads 05445b4 / 07fbfae)This patch is a larger redesign. Exception policy is now an explicit SonarCloud passes on both PRs. The 7 findings remain, most severe first. Correctness
Cleanup Tests |
|



Fixes #2820. Target: master. Draft for shared-code review and performance qualification.
ExternalServiceHandler's asynchronous work can escape the chain's configured ExceptionHandler and instantiate a default sibling policy. Carry the selected named/enabled policy, including its deliberate absence, across worker dispatch, suspended body reads, HMAC completions and proxy callbacks. Preserve established typed-error bodies, raw JSON logs and ERR10011 / HTTP 400 mapping.
Scope captures lexical policy before hand-off. A fresh capture outside a frame has no policy; custom asynchronous handlers must retain their captured scope. Earlier sub-pipeline boundaries cannot shadow later boundaries. Framework MDC uses immutable generations in a stable holder, published during serial bootstrap before asynchronous hand-off. RequestState's concurrent weak-identity index contains only MDC, never policy closures. Initialization no longer registers an exchange-completion listener. Collected exchanges are removed by bounded ReferenceQueue expunging on later registrations; idle stale entries can remain until another registration. Captured resumes read their holder directly.
The dispatcher is now package-private in proxy-handler, with two atomic fields. Its FIFO handles both owner and foreign arrivals. Fatal owner cleanup runs on the I/O owner before the terminal state is published. Executor rejection notifies exactly once on the rejecting submission, closes a separately published immutable upstream-resource lease, and reports the failure through the selected scope. This fallback reads no non-volatile proxy request/connection/attempt/stopping fields and never mutates them. Later stopped submissions close only their own incoming resources; they never invoke owner cleanup or repeat the policy. Closing a multiplexed request targets its channels, preserving the HTTP/2 parent. Rejection handling is best effort when the owning I/O executor is unavailable.
The public HandlerContinuation.Dispatcher, both Scope.isActive overloads, Scope.fail and the public generic dispatcher seam are removed. Scope keeps only operations used by production callers. ExceptionHandler no longer implements HandlerWrapper or exposes a public wrap method. It supplies its private policy through the native Undertow wrapper at the existing entry point.
RequestInterceptorInjectionHandler captures both its final downstream wrapper and a cached listener task when the body first suspends. The listener itself now uses that captured policy, including failures outside resumeRead's body-read catch. Pending reads remain pending. Nested MDC frames reuse the active context.
Ordinary and fatal fallback cleanup retains the primary failure, adds failed writes/resets as suppressed exceptions, and logs those failures. Diagnostic failures are guarded so they cannot replace the primary failure. The identity and suppression assertions are restored. No rule-keyed Sonar suppressions are added; explicit Error/Throwable guards remain visible.
The existing attempt guards, public CONNECTION attachment, HTTP/2 child-exchange push handling, independent child MDC, retry-state reset and stream-specific cancellation remain. Proxy-owned terminal responses leave benign late callbacks draining.
Validation on each branch:
Expanded command:
mvn -pl handler,exception,ingress-proxy,hmac,dump,mcp-router -am clean test -Dtest=ExternalServiceWorkerDispatchTest,ExternalServiceInterruptTest,HandlerContinuationTest,RequestInjectionContinuationTest,ExceptionContinuationTest,HandlerTest,HmacPhase0IntegrationTest,ProxyContinuationTest,ProxyCallbackDispatcherTest,BodyContinuationTest,DumpContinuationTest,McpContinuationTest,ProxyHandlerSseTest,HmacHandlerIntegrationTest,HmacReplayAdminHandlerTest,ServerConfigTest,ServerOptionRegistryTest -Dsurefire.failIfNoSpecifiedTests=false
Allocation evidence is outside the repository; no standalone probe source or machine-specific JSON is committed. A Corretto 25 ThreadMXBean component probe now includes exchange creation, initial scope/frame, immutable MDC publication, weak-index registration, dispatcher/queue creation, four capturing callback registrations and wrapper execution (20k warm-up; three 20k samples). Across review-11 runs, component allocation was approximately 1.25-1.31 KB/request with empty MDC and 2.97-3.40 KB with three fields. Final merged-code samples: master 1251-1310 / 3394-3396 bytes (empty / three fields), 2.x 1251-1304 / 2978-2980 bytes. Warm-up/JIT differences are visible; these figures are not a comparative performance guarantee. The component probe excludes actual transport and the private shutdown lease.
A separate real HTTP/1.1 loopback runs ExceptionHandler + ProxyHandler + an upstream server: 300 warm-up requests and three 500-request samples per case. All-Java-thread allocation totals, including the Java HTTP client and both transports, were approximately 19 KB/request for direct upstream requests, 129-131 KB for the proxied empty-MDC case and 131-133 KB with three MDC fields. Samples reported no thread creation/loss. These are total loopback figures, not allocation attributable solely to the continuation patch, and not production throughput qualification.
The previous master head's full source-build and native-binding CI passed. Fresh final-head checks are tracked separately; the 2.x branch has no source-build Actions workflow. Local complete-suite success is not claimed because legacy fixtures bind occupied port 7080. Shared-code review and gateway performance qualification remain open. Worker saturation/backpressure, Salesforce/MRAS qualification and changing ERR10011 to 502/504 remain outside scope.
Remote evidence on the merged code heads (7ce8033 master / 96fe84f 2.x): SonarCloud quality gate passes, with zero bugs, zero vulnerabilities and eight visible S1181 findings for intentional fatal-error and diagnostic guards. Pre-commit passes. Master source/native jobs are running. A documentation-only follow-up widens the allocation range to include observed JIT variation; production Java source and bytecode hashes are recorded in the local qualification evidence.