This is an automated email from the ASF dual-hosted git repository.
mrhhsg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 8e4bd4d5f11 [fix](be) Stop spill GC threads in workload group test
teardown (#66534)
8e4bd4d5f11 is described below
commit 8e4bd4d5f11d68ddd5fd4ae2ee153ad8d6779323
Author: Jerry Hu <[email protected]>
AuthorDate: Thu Aug 6 17:14:46 2026 +0800
[fix](be) Stop spill GC threads in workload group test teardown (#66534)
### What problem does this PR solve?
Issue Number: None
Related PR: #66328
Problem Summary:
`WorkloadGroupManagerTest` creates and initializes a `SpillFileManager`
for every test case. Initialization starts a background spill GC thread,
but the fixture did not stop or delete the manager during teardown. Each
subsequent test overwrote the global manager pointer, leaving the
previous manager and its GC thread alive.
The leaked threads could continue accessing process-wide test utilities
during static destruction and trigger an ASAN heap-use-after-free when
the test binary exited. They could also interfere with tests that use
global spill GC debug points.
This change releases workload-group-owned query resources first, then
stops and joins the spill GC thread, deletes the manager, and finally
removes the temporary spill directory. This matches the lifecycle used
by other spill-related test fixtures.
### Release note
None
### Check List (For Author)
- Test
- [ ] Regression test
- [x] Unit Test
- `GTEST_REPEAT=10 ./run-be-ut.sh --run
--filter='WorkloadGroupManagerTest.*:DebugPointsTest.AddTest:SpillFileTest.RetryPreservesDirectoryQueuedAfterPendingDrain'
-j 8`
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason
- Behavior changed:
- [x] No. This only corrects test fixture resource teardown.
- [ ] Yes.
- Does this need documentation?
- [x] No.
- [ ] Yes.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
---
be/test/runtime/workload_group/workload_group_manager_test.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/be/test/runtime/workload_group/workload_group_manager_test.cpp
b/be/test/runtime/workload_group/workload_group_manager_test.cpp
index 55213d9922f..bf7bc9e57d1 100644
--- a/be/test/runtime/workload_group/workload_group_manager_test.cpp
+++ b/be/test/runtime/workload_group/workload_group_manager_test.cpp
@@ -91,6 +91,8 @@ protected:
}
void TearDown() override {
_wg_manager.reset();
+ ExecEnv::GetInstance()->spill_file_mgr()->stop();
+ SAFE_DELETE(ExecEnv::GetInstance()->_spill_file_mgr);
ExecEnv::GetInstance()->_runtime_query_statistics_mgr->stop_report_thread();
SAFE_DELETE(ExecEnv::GetInstance()->_runtime_query_statistics_mgr);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]