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


##########
fe/fe-core/src/main/java/org/apache/doris/job/offset/jdbc/JdbcSourceOffsetProvider.java:
##########
@@ -229,9 +232,9 @@ public void fetchRemoteMeta(Map<String, String> properties) 
throws Exception {
         TNetworkAddress address = new TNetworkAddress(backend.getHost(), 
backend.getBrpcPort());
         InternalService.PRequestCdcClientResult result = null;
         try {
-            Future<PRequestCdcClientResult> future =
-                    
BackendServiceProxy.getInstance().requestCdcClient(address, request);
-            result = future.get();
+            Future<PRequestCdcClientResult> future = 
BackendServiceProxy.getInstance()
+                    .requestCdcClient(address, request, 
Config.streaming_cdc_light_rpc_timeout_sec);
+            result = future.get(Config.streaming_cdc_light_rpc_timeout_sec, 
TimeUnit.SECONDS);

Review Comment:
   `/api/fetchEndOffset` is using `streaming_cdc_light_rpc_timeout_sec` for 
both the gRPC deadline and `future.get(...)`. Per the PR description this 
endpoint is categorized as a heavy RPC (can legitimately take minutes), so it 
should use `streaming_cdc_heavy_rpc_timeout_sec` to avoid false timeouts on 
large snapshots/schema discovery.



##########
fe/fe-core/src/main/java/org/apache/doris/job/offset/jdbc/JdbcTvfSourceOffsetProvider.java:
##########
@@ -221,6 +224,10 @@ private List<Map<String, String>> fetchTaskEndOffset(long 
taskId, List<Long> sca
                     log.info("Fetched task {} offset from BE {}: {}", taskId, 
backend.getHost(), data);
                     return data;
                 }
+            } catch (TimeoutException te) {
+                log.warn("cdc_client RPC timeout api=/api/getTaskOffset 
taskId={} backend={}:{} timeout_sec={}",
+                        taskId, backend.getHost(), backend.getBrpcPort(),

Review Comment:
   This timeout log includes `taskId` and `backend`, but it omits `jobId` even 
though it’s available in this provider. Adding `jobId` would make the timeout 
WARN lines easier to aggregate consistently with the other cdc_client RPC sites.
   ```suggestion
                   log.warn("cdc_client RPC timeout api=/api/getTaskOffset 
jobId={} taskId={} backend={}:{} timeout_sec={}",
                           jobId, taskId, backend.getHost(), 
backend.getBrpcPort(),
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/job/extensions/insert/streaming/StreamingMultiTblTask.java:
##########
@@ -363,6 +370,9 @@ public String getTimeoutReason() {
             } catch (JsonProcessingException e) {
                 log.warn("Failed to get task timeout reason, response: {}", 
response);
             }
+        } catch (TimeoutException te) {
+            log.warn("cdc_client RPC timeout api=/api/getFailReason taskId={} 
timeout_sec={}",
+                    getTaskId(), Config.streaming_cdc_light_rpc_timeout_sec);

Review Comment:
   Timeout WARN logs are meant to be uniform for aggregation 
(api/jobId/backend/timeout_sec), but this timeout branch only logs `taskId` and 
`timeout_sec` and omits `jobId`/`backend`. Consider including `jobId` and 
`backend={host:port}` here (you can re-fetch the backend from 
`runningBackendId` in the catch) to keep the timeout logs consistent across 
RPCs.



##########
fe/fe-common/src/main/java/org/apache/doris/common/Config.java:
##########
@@ -1155,6 +1155,12 @@ public class Config extends ConfigBase {
     @ConfField(mutable = true, masterOnly = true)
     public static int streaming_task_timeout_multiplier = 10;
 
+    @ConfField(mutable = true, masterOnly = true)
+    public static int streaming_cdc_light_rpc_timeout_sec = 90;
+

Review Comment:
   The new default for `streaming_cdc_light_rpc_timeout_sec` is set to 90s, but 
the PR description/release note says the light RPC timeout default should be 
30s. Please align the default value (or update the PR description/release note) 
so operators get the intended behavior out of the box.



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