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 <noreply@anthropic.com>
This commit is contained in:
Chris LuandClaude Opus 5.5 committed 2026-11-27 04:24:14 -08:00
1 parent 58320c246e
commit fe0be6b04a
1 file changed
+6 -1
@@ -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();