From 3fcbb646f6d9decb7fb3dcfefc492d6f6f0c4320 Mon Sep 17 00:00:00 2001 From: Mingyu Chen Date: Fri, 10 Jul 2020 20:42:39 +0800 Subject: [PATCH] [Bug][Broker] Fix bug that the error exception is not caught when closing the broker writer (#4034) Broker should return the error status. Fix #4033 --- .../java/org/apache/doris/broker/hdfs/FileSystemManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs_brokers/apache_hdfs_broker/src/main/java/org/apache/doris/broker/hdfs/FileSystemManager.java b/fs_brokers/apache_hdfs_broker/src/main/java/org/apache/doris/broker/hdfs/FileSystemManager.java index 4bc48fdbf0..206e909ddd 100644 --- a/fs_brokers/apache_hdfs_broker/src/main/java/org/apache/doris/broker/hdfs/FileSystemManager.java +++ b/fs_brokers/apache_hdfs_broker/src/main/java/org/apache/doris/broker/hdfs/FileSystemManager.java @@ -586,6 +586,8 @@ public class FileSystemManager { fsDataInputStream.close(); } catch (IOException e) { logger.error("errors while close file input stream", e); + throw new BrokerException(TBrokerOperationStatusCode.TARGET_STORAGE_SERVICE_ERROR, + e, "errors while close file input stream"); } finally { clientContextManager.removeInputStream(fd); } @@ -645,6 +647,8 @@ public class FileSystemManager { fsDataOutputStream.close(); } catch (IOException e) { logger.error("errors while close file output stream", e); + throw new BrokerException(TBrokerOperationStatusCode.TARGET_STORAGE_SERVICE_ERROR, + e, "errors while close file output stream"); } finally { clientContextManager.removeOutputStream(fd); }