mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 02:27:26 +01:00
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:
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();
|
||||
|
||||
Reference in new issue
Block a user