From fe0be6b04af7d87f39d8e4e8c4f6498460e561ad Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 27 Nov 2026 04:24:14 -0800 Subject: [PATCH] hdfs3: close the filer client when credential options fail A credential provider error or a malformed lifetime option threw out of the store constructor after the client had opened its gRPC channels, leaving them open on every failed initialization. Co-Authored-By: Claude Opus 5.5 --- .../src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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();