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


##########
be/src/runtime/cdc_client_mgr.cpp:
##########
@@ -181,7 +200,35 @@ Status 
CdcClientMgr::start_cdc_client(PRequestCdcClientResult* result) {
     }
     std::string path(java_home);
     std::string java_bin = path + "/bin/java";
-    // Capture signal to prevent child process from becoming a zombie process
+
+    // Pre-build everything the child needs before fork(): heap allocation 
after
+    // fork() in a multi-threaded process can deadlock on inherited libc locks.
+    std::vector<std::string> argv_storage;

Review Comment:
   `cdc_client_java_opts` is registered with `DEFINE_mString`, so it can be 
changed at runtime through `set_config()`. String config updates are protected 
by `config::get_mutable_string_config_lock()` when assigning the underlying 
`std::string`, but this read copies the same string without that lock. A 
concurrent CDC request that reaches `start_cdc_client()` while an operator 
updates `cdc_client_java_opts` can race on the `std::string`, which is 
undefined behavior. Please either make this startup-only option immutable 
(`DEFINE_String`) or copy it while holding 
`*config::get_mutable_string_config_lock()` before parsing it.



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