You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "JNSimba (via GitHub)" <gi...@apache.org> on 2026/04/27 10:09:55 UTC

[PR] [fix](streaming-job) bound cdc_client RPCs with per-category timeouts [doris]

JNSimba opened a new pull request, #62870:
URL: https://github.com/apache/doris/pull/62870

   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Related PR: #xxx
   
   Problem Summary:
   
   `JdbcSourceOffsetProvider.cleanMeta()` and several other cdc_client RPCs called `future.get()` with no timeout. When the cdc_client (or PG/MySQL behind it) hangs, the call blocks forever. For `cleanMeta()` this is fatal because it runs inside `JobManager.dropJobInternal()` while holding `JobManager.writeLock()` — any subsequent `CREATE / DROP / SHOW JOB` on streaming jobs is then serialized behind the dead lock, effectively freezing the streaming-job control plane.
   
   ### Fix
   
   Introduce two configurable timeouts (mirroring the BE `brpc_light/heavy_work_pool` naming) and apply them to all 8 cdc_client RPC call sites:
   
   - `streaming_cdc_light_rpc_timeout_sec = 30` for `/api/close`, `/api/compareOffset`, `/api/getTaskOffset`, `/api/getFailReason` (expected sub-second).
   - `streaming_cdc_heavy_rpc_timeout_sec = 600` for `/api/initReader`, `/api/fetchSplits`, `/api/fetchEndOffset`, `/api/writeRecords` (may legitimately take minutes for schema discovery / large snapshot splits).
   
   Both configs are `mutable = true` so they can be tuned via `ADMIN SET FRONTEND CONFIG` without restarting FE.
   
   `BackendServiceClient.requestCdcClient` gains a timeout overload that applies a gRPC `withDeadlineAfter`; the per-call-site `future.get(...)` also passes the same timeout so the deadline is enforced on both sides.
   
   On timeout we WARN with a uniform line carrying `api / jobId / backend / timeout_sec` for easy log aggregation. `cleanMeta` keeps its existing swallow-on-failure semantics (a cleanup hiccup must not fail `DROP JOB`); the other seven sites throw `JobException` consistent with their existing `ExecutionException` handling.
   
   ### Release note
   
   Add streaming-job FE configs `streaming_cdc_light_rpc_timeout_sec` and `streaming_cdc_heavy_rpc_timeout_sec` to bound cdc_client RPCs.
   
   ### Check List (For Author)
   
   - Test
       - [ ] Regression test
       - [ ] Unit Test
       - [ ] Manual test (add detailed scripts or steps below)
       - [x] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [x] Other reason: defensive timeout — main path behavior is unchanged, the new branch only triggers when cdc_client itself is misbehaving (which is hard to reproduce in CI).
   
   - Behavior changed:
       - [x] No.
       - [ ] Yes.
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes.
   
   ### 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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](streaming-job) bound cdc_client RPCs with per-category timeouts [doris]

Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba commented on PR #62870:
URL: https://github.com/apache/doris/pull/62870#issuecomment-4340464021

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](streaming-job) bound cdc_client RPCs with per-category timeouts [doris]

Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba commented on PR #62870:
URL: https://github.com/apache/doris/pull/62870#issuecomment-4331760121

   /review


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](streaming-job) bound cdc_client RPCs with per-category timeouts [doris]

Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba closed pull request #62870: [fix](streaming-job) bound cdc_client RPCs with per-category timeouts
URL: https://github.com/apache/doris/pull/62870


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](streaming-job) bound cdc_client RPCs with per-category timeouts [doris]

Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba merged PR #62870:
URL: https://github.com/apache/doris/pull/62870


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](streaming-job) bound cdc_client RPCs with per-category timeouts [doris]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](streaming-job) bound cdc_client RPCs with per-category timeouts [doris]

Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba commented on PR #62870:
URL: https://github.com/apache/doris/pull/62870#issuecomment-4340387978

   /review


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](streaming-job) bound cdc_client RPCs with per-category timeouts [doris]

Posted by "Thearas (via GitHub)" <gi...@apache.org>.
Thearas commented on PR #62870:
URL: https://github.com/apache/doris/pull/62870#issuecomment-4326058824

   
   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/How+to+process+your+PR).
   
   Please clearly describe your PR:
   1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
   2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
   3. What features were added. Why was this function added?
   4. Which code was refactored and why was this part of the code refactored?
   5. Which functions were optimized and what is the difference before and after the optimization?
       


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](streaming-job) bound cdc_client RPCs with per-category timeouts [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #62870:
URL: https://github.com/apache/doris/pull/62870#issuecomment-4344362216

   PR approved by at least one committer and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](streaming-job) bound cdc_client RPCs with per-category timeouts [doris]

Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba commented on PR #62870:
URL: https://github.com/apache/doris/pull/62870#issuecomment-4340512416

   Addressed Copilot review comments:
   
   1. **fetchEndOffset light vs heavy** — Code is correct (light is right since the BE-side handler is just `pg_current_wal_lsn()` / `SHOW MASTER STATUS`, sub-second). Updated PR description to match.
   2. **light default 90s vs 30s** — 90s is intentional: covers BE `start_cdc_client` cold-start health-check loop (~45s worst case). Updated PR description with rationale.
   3. **getFailReason WARN missing jobId/backend** — Fixed in ac29a538591: hoisted `Backend backend` out of the try-block and now log `jobId / taskId / backend={host}:{port} / timeout_sec`.
   4. **getTaskOffset WARN missing jobId** — Fixed in ac29a538591: now log `jobId / taskId / backend={host}:{port} / timeout_sec`.
   
   WARN format is now uniform across all cdc_client RPC call sites.


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](streaming-job) bound cdc_client RPCs with per-category timeouts [doris]

Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba commented on PR #62870:
URL: https://github.com/apache/doris/pull/62870#issuecomment-4348712300

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](streaming-job) bound cdc_client RPCs with per-category timeouts [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #62870:
URL: https://github.com/apache/doris/pull/62870#issuecomment-4344362629

   PR approved by anyone and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](streaming-job) bound cdc_client RPCs with per-category timeouts [doris]

Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba commented on PR #62870:
URL: https://github.com/apache/doris/pull/62870#issuecomment-4350582359

   run p0


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](streaming-job) bound cdc_client RPCs with per-category timeouts [doris]

Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba commented on PR #62870:
URL: https://github.com/apache/doris/pull/62870#issuecomment-4332849066

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](streaming-job) bound cdc_client RPCs with per-category timeouts [doris]

Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba commented on PR #62870:
URL: https://github.com/apache/doris/pull/62870#issuecomment-4350583004

   run cloud_p0


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](streaming-job) bound cdc_client RPCs with per-category timeouts [doris]

Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba commented on PR #62870:
URL: https://github.com/apache/doris/pull/62870#issuecomment-4351411953

   run p0


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org