morningman opened a new pull request, #69915:
URL: https://github.com/apache/doris/pull/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 |
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [x] Unit Test
- [ ] 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 <!-- Add your reason? -->
`run-be-ut.sh --run --filter='TimeSharingTaskExecutorTest.*'` on macOS
arm64 (ASAN): 13 tests pass.
- Behavior changed:
- [x] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should
merge into -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]