morningman opened a new pull request, #68492:
URL: https://github.com/apache/doris/pull/68492
### What problem does this PR solve?
Issue Number: N/A
Related PR: #66399
Problem Summary:
The BE installs a process-wide SIGCHLD handler for the CDC client, but the
handler used `waitpid(-1, ...)`. It could collect a child launched by the
embedded JVM before the JVM's process reaper saw it. Java code could then
receive a false success exit status for a failed subprocess.
Scope this handler's wait to the owned CDC client. A generation-qualified
child identity and exclusive operation claim coordinate the signal handler with
startup, inspection, and shutdown, so those paths cannot act on a PID after it
has been reaped and reused. The tests cover unrelated children, signal-handler
reaping, concurrent operations, and stale PID generations.
This PR contains only `be/src/runtime/cdc_client_mgr.{cpp,h}` and
`be/test/runtime/cdc_client_mgr_test.cpp`, copied exactly from the current head
of #66399. It leaves #66399 unchanged.
### Release note
Fix CDC client lifecycle handling so BE preserves the exit status of
unrelated child processes.
### Check List (For Author)
- Test
- [ ] Unit Test: `CdcClientMgrTest` could not run locally because
`thirdparty/installed/lib64/libsimdutf.a` is missing.
- [x] Manual test: `build-support/clang-format.sh`,
`build-support/check-format.sh`, `build-support/check-build-hygiene.sh`, `git
diff --check`, and exact file comparison with #66399 passed.
- [ ] ASAN BE build: stopped during CLucene CMake configuration after
two `try_run` probes hung on this Mac, before compiling the changed source.
- [ ] Clang-tidy: could not complete with the existing Release
compilation database because of libc++ system-header parse errors.
- Behavior changed:
- [x] Yes. The handler reaps only the CDC child; lifecycle operations
are guarded against PID reuse.
- Does this need documentation?
- [x] No.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
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]