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


##########
be/src/runtime/cdc_client_mgr.cpp:
##########
@@ -215,10 +234,31 @@ Status 
CdcClientMgr::start_cdc_client(PRequestCdcClientResult* result) {
         dup2(out_fd, STDERR_FILENO);
         close(out_fd);
 
-        // java -jar -Dlog.path=xx cdc-client.jar --server.port=9096 
--backend.http.port=8040
-        execlp(java_bin.c_str(), "java", java_opts.c_str(), "-jar", 
cdc_jar_path.c_str(),
-               cdc_jar_port.c_str(), backend_http_port.c_str(), 
cluster_token.c_str(), (char*)NULL);
-        // If execlp returns, it means it failed
+        // java <user_java_opts...> -Dlog.path=xx -jar cdc-client.jar

Review Comment:
   This code now builds `std::vector`/`std::string` objects and parses 
`cdc_client_java_opts` in the child after `fork()` and before `execv()`. BE is 
multi-threaded, so the forked child may inherit allocator/libstdc++ locks held 
by another thread; calling non-async-signal-safe C++ allocation/parsing here 
can deadlock the child before `execv`, leaving `start_cdc_client()` to wait for 
health until it fails. Please construct the argv storage (and any other 
heap-backed strings needed by the child) before `fork()`, then have the child 
only do the minimal fd setup and `execv()` with the already-built `argv.data()`.



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