Fix synchronous throttled request failures#963
Conversation
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe request handlers for CQL, prepare, graph, and continuous CQL now catch exceptions thrown during throttled request setup, including execution-profile resolution, query-plan construction, metrics updates, and initial dispatch. Failures are routed through existing final-error or abort paths, and continuous requests also signal the throttler. A CQL test verifies that a query-plan creation exception completes the returned future exceptionally with the same exception. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Add top-level error handling around
onThrottleReady()request setup for:Fixes #949.
Root cause
Request throttlers invoke
onThrottleReady()directly. Query-plan creation, execution-profileresolution, metric updates, or request scheduling can throw synchronously from this callback.
Those exceptions previously bypassed the request handlers' normal terminal-error paths. On the
immediate throttler path, this could make
executeAsync()throw instead of returning a failedfuture. On a queued path, the exception could escape on the throttler or event-loop thread and
leave the request future incomplete.
Solution
Wrap each request handler's
onThrottleReady()setup in a catch-all error boundary and routefailures through its existing terminal-error flow.
This ensures that synchronous setup failures:
A regression test verifies that a synchronous query-plan creation failure is returned through a
failed completion stage instead of escaping request construction.
Testing
CqlRequestHandlerTest: 7 tests passedCqlPrepareHandlerTest: 9 tests passedGraphRequestHandlerTest: 30 tests passedContinuousGraphRequestHandlerTest: 5 tests passedgit diff --checkpassed