github-actions[bot] commented on code in PR #68492:
URL: https://github.com/apache/doris/pull/68492#discussion_r4100144339


##########
be/test/runtime/cdc_client_mgr_test.cpp:
##########
@@ -123,7 +127,7 @@ TEST_F(CdcClientMgrTest, StopWithoutChild) {
     mgr.stop();
 }
 

Review Comment:
   [P2] Prove the SIGCHLD handler ran before reaping the unrelated child.
   
   This test sleeps for 600 ms and then calls blocking `waitpid(pid)`, but 
never observes that `handle_sigchld` actually executed. If scheduling or signal 
delivery is delayed, `waitpid` can reap the unrelated child itself; the test 
then passes and `mgr.stop()` merely clears the fake CDC identity without 
exercising the replacement for `waitpid(-1)`. Add a deterministic handler-run 
checkpoint, for example using the existing test pause hook around the handler 
and waiting for its paused flag, before reaping the child.



##########
be/src/runtime/cdc_client_mgr.cpp:
##########
@@ -50,16 +53,334 @@
 namespace doris {
 
 namespace {
-// Handle SIGCHLD signal to prevent zombie processes
+// The identity of the cdc client this process forked, published for 
handle_sigchld(). A signal
+// handler may only touch lock-free atomics, so the pid and its generation 
live in one 64-bit word
+// rather than behind CdcClientMgr's mutex. The generation prevents a delayed 
handler from clearing
+// ownership after the kernel has already reused the same numeric pid for a 
replacement child.
+// ExecEnv owns a single CdcClientMgr, so there is a single published identity.
+static_assert(sizeof(pid_t) <= sizeof(uint32_t));

Review Comment:
   [P2] Exercise the production startup state machine.
   
   All BE unit tests compile with `BE_TEST`, so this branch returns after 
publishing synthetic PID `99999` and never executes the newly changed 
fork/publication window, early-exit reap, health-check failure cleanup, final 
inspection, or external-adoption logic below. The ownership helper tests cannot 
prove those end-to-end transitions. Please add a non-BE_TEST/integration case 
or inject the fork/health outcomes so these production-only paths are actually 
driven.



-- 
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]

Reply via email to