Fix worker gone test failure in sandbox - #21270
Conversation
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|
❌ Gradle check result for 64d145c: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #21270 +/- ##
============================================
- Coverage 73.22% 73.19% -0.04%
- Complexity 73325 73355 +30
============================================
Files 5910 5911 +1
Lines 334422 334825 +403
Branches 48207 48243 +36
============================================
+ Hits 244880 245066 +186
- Misses 69964 70139 +175
- Partials 19578 19620 +42 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@mch2 Can you look at this? |
* Fix worker gone test failure in sandbox Signed-off-by: Craig Perkins <cwperx@amazon.com> * Fix flaky test Signed-off-by: Craig Perkins <cwperx@amazon.com> --------- Signed-off-by: Craig Perkins <cwperx@amazon.com> Signed-off-by: Abhishek Som <abhissom@amazon.com>
* Fix worker gone test failure in sandbox Signed-off-by: Craig Perkins <cwperx@amazon.com> * Fix flaky test Signed-off-by: Craig Perkins <cwperx@amazon.com> --------- Signed-off-by: Craig Perkins <cwperx@amazon.com> Signed-off-by: Divya <divyruhil999@gmail.com>
* Fix worker gone test failure in sandbox Signed-off-by: Craig Perkins <cwperx@amazon.com> * Fix flaky test Signed-off-by: Craig Perkins <cwperx@amazon.com> --------- Signed-off-by: Craig Perkins <cwperx@amazon.com>
* Fix worker gone test failure in sandbox Signed-off-by: Craig Perkins <cwperx@amazon.com> * Fix flaky test Signed-off-by: Craig Perkins <cwperx@amazon.com> --------- Signed-off-by: Craig Perkins <cwperx@amazon.com>
Description
Reliably reproduce the test failure with
./gradlew :sandbox:plugins:analytics-backend-datafusion:test -Dtests.seed=218506E88D711883 -Dtests.jvms=1 -iFixes a flaky test failure in
DatafusionSearchExecEngineTestswheretestEngineExecuteAggregationandtestEngineExecuteSelectAllfail withRuntimeException: Execution error: Worker gone.Root cause:
DataFusionJniBridgeTestscalledNativeBridge.shutdownTokioRuntimeManager()at the end of bothtestRuntimeLifecycle()andtestReaderLifecycle(). This permanently shuts down theDedicatedExecutor's CPU thread pool inside the RustRuntimeManager. Because the native side stores the runtime manager in aOnceLock, subsequent calls toinitTokioRuntimeManager()from other test classes are no-ops — the shut-down manager stays in place. WhenDatafusionSearchExecEngineTestsorDataFusionQueryExecutionTestsrun later in the same JVM (Gradle does not setforkEvery, so all test classes share one JVM),CrossRtStreamtries to spawn work on the dead executor and getsJobError::WorkerGone.The failure is order-dependent: it only occurs when
DataFusionJniBridgeTestsruns before the other test classes. Since OpenSearch's randomized test runner controls class ordering via seed, the failure is flaky — it depends on the seed drawn for that CI run.Fix: Remove the
shutdownTokioRuntimeManager()calls fromDataFusionJniBridgeTests. Per-test resources (DataFusionRuntimeviacreateGlobalRuntime, readers) are still properly cleaned up. Only the process-levelRuntimeManageris left alive for the duration of the JVM, which is the correct behavior for a shared singleton.Check List
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.