Reset retry task state between test suites [reduced-it] #16983
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 370 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.354
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #16983"
general
weight: 0.35
res-life
Fixes #16982.
Description
TaskRegistryTrackerandScalableTaskCompletionkeep retry task registrations and task-completion callbacks for the whole JVM, keyed by task attempt id. A suite that registers a mock task that never completes leaves them behind. In a parallel test worker, the real tasks of later SparkContexts reuse those task ids and join the stale entries: their completion callbacks never run, their threads stay registered as dedicated task threads, and later tasks on those threads are no longer associated with a task in RMM. Retry OOM injection then fails withthe thread is not associated with any task/shuffle, as inParquetScanSuiteafterGpuNullBatchIteratorSuite(see the issue).This change:
ScalableTaskCompletionandTaskRegistryTrackerinParallelUnitTestRunner.cleanupWorkerState, so every suite in a worker starts without the retry task state of the suites before it, in the same order as #16964 does forWithRetrySuite;GpuNullBatchIteratorSuitesemaphore test, which left the state behind, inTestUtils.withTaskContext, which resets their callbacks when the test ends, so that serial runs in one JVM are also clean.Tests:
ParallelUnitTestRunnerSuite: a mock task 1 registers a dedicated thread and a completion callback and never completes. AftercleanupWorkerState, the callback has run, and a new task 1 on the same thread registers its thread and unregisters it when it completes. The test fails without the reset incleanupWorkerState.Validation:
c3175518cdwith Spark 3.5.2 (-Dbuildver=352) by running, in one JVM, the 34 suites that precededParquetScanSuitein the failing CI worker and thenParquetScanSuite: its three OOM-injection tests failed with the CI error. With this change, the same sequence passed (504 tests).ParallelUnitTestRunnerSuiteandGpuNullBatchIteratorSuitewith-Dbuildver=352and with-Dbuildver=420(Scala 2.13): 32 passed on each. Without the reset incleanupWorkerState, the new test fails.This change and the PR description were prepared with AI assistance and reviewed by the author before submission.
Checklists
Documentation
Testing
(Please provide the names of the existing tests in the PR description.)
Performance
This changes test code only, which is not packaged in runtime artifacts.