From ec007c4bf27ea4e9ff7d77ae6c79a846b9f6a1a4 Mon Sep 17 00:00:00 2001 From: Atri Sharma Date: Fri, 24 Jul 2020 09:57:58 +0530 Subject: [PATCH] Use FileSystem.newInstance instead of FileSystem.get in HDFSBackupRepository (#1682) FileSystem.get can cause FileSystem closed exceptions, especially with S3. --- .../solr/core/backup/repository/HdfsBackupRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solr/core/src/java/org/apache/solr/core/backup/repository/HdfsBackupRepository.java b/solr/core/src/java/org/apache/solr/core/backup/repository/HdfsBackupRepository.java index 30d58fe57d7..ada0b57a29f 100644 --- a/solr/core/src/java/org/apache/solr/core/backup/repository/HdfsBackupRepository.java +++ b/solr/core/src/java/org/apache/solr/core/backup/repository/HdfsBackupRepository.java @@ -98,7 +98,7 @@ public class HdfsBackupRepository implements BackupRepository { } try { - this.fileSystem = FileSystem.get(this.baseHdfsPath.toUri(), this.hdfsConfig); + this.fileSystem = FileSystem.newInstance(this.baseHdfsPath.toUri(), this.hdfsConfig); } catch (IOException e) { throw new SolrException(ErrorCode.SERVER_ERROR, e); }