Repository navigation
Conversation
PR Reviewer Guide 🔍(Review updated until commit bbdfe7e)Here are some key observations to aid the review process:
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5957 +/- ##
=========================================
Coverage 89.12% 89.13%
- Complexity 12156 12177 +21
=========================================
Files 974 978 +4
Lines 41718 41812 +94
Branches 4800 4809 +9
=========================================
+ Hits 37183 37269 +86
- Misses 3070 3075 +5
- Partials 1465 1468 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
291212f to
eb5e16d
Compare
|
Persistent review updated to latest commit eb5e16d |
PR Code Suggestions ✨Latest suggestions up to bbdfe7e Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit b9a4b9b
Suggestions up to commit eb5e16d
|
eb5e16d to
b9a4b9b
Compare
|
Persistent review updated to latest commit b9a4b9b |
With wait_for_completion_timeout=0, QueryJob.await subscribed to the job's completion before taking the Running fast path. Calcite analysis runs on the sql-worker thread, so a fast failure there (e.g. field not found) could complete the job before the submitting thread reached await(0). The subscription then fired inline and the submit returned the engine error as a sync 400 instead of the job id, which flaked AsyncPPLMultiNodeRoutingIT.failed_forwardsFromNonOwnerNodeToOwner. Answer Running for a zero budget before subscribing, unless the runner refused the query while starting. PPLQueryRunner treats a failure that PPLService.execute reports on the calling thread before it returns (a parse error or a saturated sql-worker pool, raised before the query is handed to a worker) as a refusal and throws it from run(); engine failures arrive on worker threads and complete the future. Refusals still fail the submit inline (400/429); engine failures are reported through GET. PPLService and thread pool usage are unchanged. Signed-off-by: Peng Huo <penghuo@gmail.com>
b9a4b9b to
bbdfe7e
Compare
|
Persistent review updated to latest commit bbdfe7e |
Description
AsyncPPLMultiNodeRoutingIT.failed_forwardsFromNonOwnerNodeToOwnerfails intermittently (CI run). An async PPL submit withwait_for_completion_timeout=0sometimes returns the query error as a sync 400 instead of the job id.Root cause. Calcite analysis, including field resolution, runs on the
sql-workerthread.QueryJob.await(Duration)subscribed to the job's completion before handling a zero budget. When the worker failed before the submitting thread reachedawait(0), the subscription completed the result exceptionally and theRunninganswer was dropped.Fix.
QueryJob.awaitanswersRunningfor a zero budget before subscribing, so a failure on a worker thread is always reported through GET, whatever the timing.sql-workerpool) still fails the submit inline with 400/429, asWorkerPoolSaturationITrequires.PPLService.executereports such a rejection on the calling thread before it returns.PPLQueryRunnertreats exactly that case as a refusal and throws it fromrun(), andQueryJobthen failsawait(0)with it.wait=0submitsql-workersaturated)sql-complex-workersaturated, execution error)FAILEDRequests with a positive
wait_for_completion_timeoutand sync requests behave as before.QueryJobTest.await_failureAfterExpiryWithoutPollReportsOutcomeasserted the racy behavior, so it is renamed toawait_failureBeforeZeroBudget_stillReturnsRunningand now expectsRunning.PPLQueryRunnerTest.run_propagatesQueryFailureis replaced by two tests: one for a rejection on the calling thread, one for a worker failure that arrives beforeexecutereturns.Related Issues
No issue filed; the flaky CI run is linked above.
Check List
--signoffor-s.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.