This is an automated email from the ASF dual-hosted git repository.

hello-stephen 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 347b9a03cf5 [test](be) Set the thread counts in 
TimeSharingTaskExecutorTest.test_invalid_task_handle_returns_error (#69915)
347b9a03cf5 is described below

commit 347b9a03cf5fdd4bfc163eadfbf38b41cab06c2d
Author: Mingyu Chen (Rayner) <[email protected]>
AuthorDate: Sun Nov 1 23:52:04 2026 +0000

    [test](be) Set the thread counts in 
TimeSharingTaskExecutorTest.test_invalid_task_handle_returns_error (#69915)
    
    ### What problem does this PR solve?
    
    Issue Number: None
    
    Related PR: #65054
    
    Problem Summary:
    
    **In short:**
    `TimeSharingTaskExecutorTest.test_invalid_task_handle_returns_error`
    builds its executor from a `ThreadConfig` whose thread counts are never
    set, so BE UT runs intermittently die in it with a core dump. This PR
    sets the two counts in the test.
    
    **Background:** `TimeSharingTaskExecutor::ThreadConfig::max_thread_num`
    and `min_thread_num` are plain `int` fields without a default value. The
    other ten `ThreadConfig`s in `time_sharing_task_executor_test.cpp` set
    both; the test added by #65054 sets only `thread_name` and
    `workload_group` before calling `init()`.
    
    **The problem, and what it cost:** `init()` sizes the thread pool from
    whatever the stack holds. When that value is large, it keeps creating
    threads until mmap fails:
    
    ```
    ==38657==ERROR: AddressSanitizer failed to allocate 0xfc000 (1032192) bytes 
at address 0x0f63acfd7000 (errno: 12)
    ==38657==ERROR: AddressSanitizer: SEGV on unknown address 0x0ab44632aa9e ...
    ```
    
    TeamCity then reports `Build stopped: CORE DUMPED`, and no suite
    scheduled after this test runs, so the run says nothing about the PR's
    own BE tests that come later. Between 2026-10-24 and 10-31 this happened
    in 4 of 11 sampled BE UT runs, on four different PRs (build 1087538 on
    #69581 is one); a rerun passes.
    
    **How this PR fixes it:** set `max_thread_num` and `min_thread_num` to
    0, as `test_remove_task_clears_queued_task_count` in the same file does.
    The test only calls `init()` and checks that null and foreign task
    handles are rejected, so it needs no worker thread. Test-only change;
    the executor is unchanged.
    
    **Results:**
    
    | | Before | After |
    |---|---|---|
    | Thread counts of the test's executor | whatever the stack holds | 0 /
    0 |
    | BE UT | aborts in this test in some runs (4 of 11 sampled) | the test
    no longer depends on stack contents |
    
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
---
 be/test/exec/executor/time_sharing/time_sharing_task_executor_test.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/be/test/exec/executor/time_sharing/time_sharing_task_executor_test.cpp 
b/be/test/exec/executor/time_sharing/time_sharing_task_executor_test.cpp
index 2892ed424a5..39dce576f62 100644
--- a/be/test/exec/executor/time_sharing/time_sharing_task_executor_test.cpp
+++ b/be/test/exec/executor/time_sharing/time_sharing_task_executor_test.cpp
@@ -471,6 +471,8 @@ TEST_F(TimeSharingTaskExecutorTest, 
test_invalid_task_handle_returns_error) {
     TimeSharingTaskExecutor::ThreadConfig thread_config;
     thread_config.thread_name = "invalid_task_handle";
     thread_config.workload_group = "normal";
+    thread_config.max_thread_num = 0;
+    thread_config.min_thread_num = 0;
     TimeSharingTaskExecutor executor(thread_config, 0, 1, 1, ticker);
     ASSERT_TRUE(executor.init().ok());
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to