diff --git a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java index 1f783cf066..f4fa558634 100644 --- a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java +++ b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java @@ -30,7 +30,12 @@ public class SeaweedFileSystemStore { public SeaweedFileSystemStore(String host, int port, int grpcPort, String cn, Configuration conf) throws IOException { filerClient = new FilerClient(host, port, grpcPort, cn); this.conf = conf; - SeaweedFileSystem.applyFilerCredentials(conf, filerClient.getFilerCredentials()); + try { + SeaweedFileSystem.applyFilerCredentials(conf, filerClient.getFilerCredentials()); + } catch (IOException | RuntimeException e) { + close(); + throw e; + } String volumeServerAccessMode = this.conf.get(FS_SEAWEED_VOLUME_SERVER_ACCESS, "direct"); if (volumeServerAccessMode.equals("publicUrl")) { filerClient.setAccessVolumeServerByPublicUrl();