refactor: Add shared AsyncRequest helper class for async HTTP requests using AsyncContext #20784
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.36) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 204 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.318
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #20784"
general
weight: 0.35
gianm
Description
OverlordResourcehad a small private nested classAsyncRequestthat safely completes an async HTTP response exactly once (guarding against writing to an already-completed or timed-out request). This PR extracts it into a standalone, reusableorg.apache.druid.server.http.AsyncRequest, exposed as a fluent builder, and migrates other resource classes with a similar pattern to use it.Changes
AsyncRequest(fluent builder) andAsyncResponse(small value type describing a response) todruid-server.OverlordResourceto use the new builder, removing its private nestedAsyncRequest.SegmentListerResource,TaskManagementResource, andMessageRelayResource— other resource classes with a similar "wait on a future, then write the result or an error" shape.QueryResourceandWorkerResourceuntouched since their usage doesn't fit this abstraction.Testing
AsyncRequestTestcovering success/failure/timeout handling, builder validation, and the double-completion guard.SegmentListerResourceTestandOverlordResourceTestpass unchanged.🤖 Generated with Claude Code