From 4137e66fdd62ef3320813f10eb858c92acec3f61 Mon Sep 17 00:00:00 2001 From: Lijia Liu Date: Mon, 3 Mar 2025 11:02:49 +0800 Subject: [PATCH] [fix](broker) fix fd always timeout (#48494) ### What problem does this PR solve? come from https://github.com/apache/doris/pull/28589 ### Release note None ### Check List (For Author) - Test - [ ] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] 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. - [ ] Other reason - Behavior changed: - [ ] No. - [ ] Yes. - Does this need documentation? - [ ] No. - [ ] Yes. ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label Co-authored-by: liutang123 --- .../apache/doris/broker/hdfs/ClientContextManager.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs_brokers/apache_hdfs_broker/src/main/java/org/apache/doris/broker/hdfs/ClientContextManager.java b/fs_brokers/apache_hdfs_broker/src/main/java/org/apache/doris/broker/hdfs/ClientContextManager.java index 2df4c12a7fda8d..8e2fcfe60de02f 100644 --- a/fs_brokers/apache_hdfs_broker/src/main/java/org/apache/doris/broker/hdfs/ClientContextManager.java +++ b/fs_brokers/apache_hdfs_broker/src/main/java/org/apache/doris/broker/hdfs/ClientContextManager.java @@ -145,11 +145,11 @@ public synchronized void remoteExpireInputStreams() { fd = entry.getKey(); if (entry.getValue().checkExpire(inputStreamExpireSeconds)) { ClientContextManager.this.removeInputStream(fd); + iter.remove(); + logger.info(fd + " in client [" + clientContext.clientId + + "] is expired, remove it from contexts. last update time is " + + entry.getValue().getLastPingTimestamp()); } - iter.remove(); - logger.info(fd + " in client [" + clientContext.clientId - + "] is expired, remove it from contexts. last update time is " - + entry.getValue().getLastPingTimestamp()); } } } @@ -167,7 +167,7 @@ public void run() { ClientContextManager.this.removeOutputStream(fd); } clientContexts.remove(clientContext.clientId); - logger.info("client [" + clientContext.clientId + logger.info("client [" + clientContext.clientId + "] is expired, remove it from contexts. last access time is " + clientContext.lastAccessTimestamp); }