Copilot commented on code in PR #63898:
URL: https://github.com/apache/doris/pull/63898#discussion_r3323020280


##########
be/src/common/config.cpp:
##########
@@ -73,6 +73,8 @@ DEFINE_Int32(arrow_flight_sql_port, "8050");
 
 DEFINE_Int32(cdc_client_port, "9096");
 
+DEFINE_mString(cdc_client_java_opts, "");

Review Comment:
   The implementation default remains empty, so deployments that do not pick up 
the updated sample `be.conf` (for example existing clusters during upgrade) 
will not get `-XX:+ExitOnOutOfMemoryError` by default. Since this option is 
intended to be the default behavior, set the config default here as well and 
let `be.conf` override it when present.



##########
be/src/runtime/cdc_client_mgr.cpp:
##########
@@ -149,10 +152,26 @@ Status 
CdcClientMgr::start_cdc_client(PRequestCdcClientResult* result) {
             _child_pid.store(0);
         }
 #endif
-    } else {
+    } else if (!_adopted_external.load()) {
         LOG(INFO) << "CDC client has never been started";
     }
 
+#ifndef BE_TEST
+    // Adopt an externally-managed cdc_client if the port already answers
+    // healthy (e.g. one started manually for debug / hotfix).
+    {
+        std::string adopt_response;
+        if (check_cdc_client_health(1, 0, adopt_response).ok()) {
+            if (!_adopted_external.exchange(true)) {
+                LOG(INFO) << "Adopting external cdc client on port "
+                          << doris::config::cdc_client_port;
+            }
+            return Status::OK();

Review Comment:
   This new adoption branch is not exercised by the existing test suite because 
`start_cdc_client()` returns through the `BE_TEST` short-circuit before this 
`#ifndef BE_TEST` logic. Please add coverage using a test seam or non-`BE_TEST` 
path that verifies a healthy process on the port is adopted and `_child_pid` is 
not set to a forked child.



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