[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
This commit is contained in:
Mingyu Chen
2020-07-10 20:42:39 +08:00
committed by GitHub
parent 265c26f67d
commit 3fcbb646f6

View File

@ -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);
}