Skip to content

minor: Complete CollectedAsyncResource immediately on failure. - #20504

Merged
gianm merged 2 commits into
apache:masterfrom
gianm:collect-fail-fast
Oct 9, 2026
Merged

gianm merged 2 commits into
apache:masterfrom
gianm:collect-fail-fast

Conversation

@gianm

@gianm gianm commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Rather than waiting for all source resources to complete, we can immediately complete the target resource if any source resource fails. This prevents doing needless work gathering up all the other resources, and allows them to be closed (and therefore potentially canceled) more quickly.

Rather than waiting for all source resources to complete, we can
immediately complete the target resource if any source resource fails.
This prevents doing needless work gathering up all the other resources,
and allows them to be closed (and therefore potentially canceled)
more quickly.

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No actionable correctness or lifecycle issues found. The failure callback propagates a source error promptly while leaving the remaining sources owned by the collected resource; successful collection still returns values in source order. I also inspected the async resource callback and close behavior, the transform and recovery combinators, and all production call sites of AsyncResources.collect.

Reviewed all 4 of 4 changed files: processing/src/main/java/org/apache/druid/common/asyncresource/AsyncResources.java, processing/src/main/java/org/apache/druid/common/asyncresource/CollectAsyncResource.java, processing/src/test/java/org/apache/druid/common/asyncresource/AsyncResourcesTest.java, and processing/src/test/java/org/apache/druid/common/asyncresource/CollectAsyncResourceTest.java.

Validation: git diff --check a38a81f1ce309b6bddb0300715b6e63d13772cf6...HEAD passed. Static review only; tests were not run.


This is an automated review by Codex GPT-5.6-Luna(max)

@gianm
gianm merged commit 165e9b9 into apache:master Oct 9, 2026
27 checks passed
@gianm
gianm deleted the collect-fail-fast branch October 9, 2026 19:56
@github-actions github-actions Bot added this to the 39.0.0 milestone Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants