Repository navigation
Fail PPL queries refused by a saturated SQL worker pool with 429 - #5915
Conversation
…nsearch-project#5801) OpenSearchQueryManager and ThreadPoolExecutionDispatcher submitted work with ThreadPool.schedule and a zero delay. When sql-worker or sql-complex-worker was full, the rejection was raised on the scheduler thread and never reached the query's listener: a sync query got no response and an async query stayed RUNNING forever. Submit to the executor directly and report the rejection as 429 "[pool] thread pool is saturated; retry later". A rejection on the complex pool goes straight to the listener so it does not trigger the V2 fallback. Signed-off-by: Peng Huo <[email protected]>
…ject#5801) Signed-off-by: Peng Huo <[email protected]>
Signed-off-by: Peng Huo <[email protected]>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5915 +/- ##
============================================
- Coverage 75.38% 75.37% -0.01%
- Complexity 10386 10387 +1
============================================
Files 962 963 +1
Lines 41089 41103 +14
Branches 4681 4683 +2
============================================
+ Hits 30975 30983 +8
- Misses 8806 8812 +6
Partials 1308 1308
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:
|
Description
When the SQL worker thread pools were full, a new PPL query was dropped without an error. A normal query never got a response, and an async query showed
RUNNINGforever and was never cleaned up.The query was handed to
sql-workerandsql-complex-workerthroughThreadPool.schedulewith a zero delay. The pool's rejection then happened on the scheduler thread, so it never reached the query.Now the query is handed to the pool directly, and a rejection fails the query right away with
429"thread pool is saturated; retry later":429.429. If the query's id was already returned, GET reports itFAILEDwith the same error.A rejection by
sql-complex-workeris reported straight to the query, so it does not fall back to the V2 engine and run again on the same busy node.Normal execution does not change: the query runs on the same pool, with the same thread context.
Related Issues
Part of #5801
Parent: #5765
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.