You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[#26731] docdb: enable test for process supervisor
Summary:
Reworks a regression test for the bug #26731 so it can be enabled.
The original bug as a seg fault in `process_supervisor` when starting a process failed. 0f4ec65 fixed this issue and added a unit test. However the unit test reproduced the failure to spawn a process by exhausting the system's thread count, spawning threads in a loop. This test destabilized the machine it ran on so it was disabled.
This diff reworks the test, using a test fake to reproduce the desired failure to spawn a new process. The test runs in under a second and it reproduces the original bug when the prod fix is removed.
Jira: DB-16106
Test Plan:
```
./yb_build.sh release --cxx-test process_wrapper-test --gtest_filter 'ProcessWrapperTest.ProcessWrapperStartFails' -n 100 --stop-at-failure
```
This test fails w/ a segfault [0] when the fix is removed (see diff at [1]).
[0]
```
I0923 14:00:57.549199 1832153088 process_wrapper.cc:104] Restarting test sleep process process
W0923 14:00:57.549203 1832153088 process_wrapper.cc:107] Failed trying to start test sleep process process: Illegal state (yb/yql/process_wrapper/process_wrapper-test.cc:164): Failed to spawn sleep process due to count hit, waiting a bit
*** Aborted at 1758650458 (unix time) try "date -d @1758650458" if you are using GNU date ***
PC: @ 0x0 perftools_pthread_specific_vals
*** SIGSEGV (@0xe0) received by PID 33927 (TID 0x16d347000) stack trace: ***
@ 0x1906bb584 _sigtramp
@ 0x1031d89d8 yb::ProcessSupervisor::RunThread()
@ 0x1031d89d8 yb::ProcessSupervisor::RunThread()
@ 0x10750e408 yb::Thread::SuperviseThread()
@ 0x19068af94 _pthread_start
@ 0x190685d34 thread_start
```
[1]
```
% git diff
diff --git a/src/yb/yql/process_wrapper/process_wrapper.cc b/src/yb/yql/process_wrapper/process_wrapper.cc
index 7498ffb..01b172a63b 100644
--- a/src/yb/yql/process_wrapper/process_wrapper.cc
+++ b/src/yb/yql/process_wrapper/process_wrapper.cc
@@ -66,7 +66,7 @@ void ProcessSupervisor::RunThread() {
});
std::string process_name = GetProcessName();
while (true) {
- if (process_wrapper_) {
+ // if (process_wrapper_) {
Result<int> wait_result = process_wrapper_->Wait();
if (wait_result.ok()) {
int ret_code = *wait_result;
@@ -87,7 +87,7 @@ void ProcessSupervisor::RunThread() {
continue;
}
}
- }
+ // }
{
UniqueLock lock(mtx_);
```
Reviewers: timur
Reviewed By: timur
Subscribers: rthallam, ybase, yql
Differential Revision: https://phorge.dev.yugabyte.com/D46953
0 commit comments