Skip to content

Commit 6696e10

Browse files
committed
Fixing FS close
1 parent 5bd8b2a commit 6696e10

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystem.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public class AzureBlobFileSystem extends FileSystem
148148
private URI uri;
149149
private Path workingDir;
150150
private AzureBlobFileSystemStore abfsStore;
151-
private boolean isClosed;
151+
private boolean isClosed = true;
152152
private final String fileSystemId = UUID.randomUUID().toString();
153153

154154
private boolean delegationTokenEnabled = false;
@@ -312,6 +312,7 @@ public void initialize(URI uri, Configuration configuration)
312312
}
313313

314314
rateLimiting = RateLimitingFactory.create(abfsConfiguration.getRateLimit());
315+
isClosed = false;
315316
LOG.debug("Initializing AzureBlobFileSystem for {} complete", uri);
316317
}
317318

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestFileSystemInitialization.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,13 @@ public void testFileSystemCapabilities() throws Throwable {
9898
FS_ACLS, acls, fs)
9999
.isEqualTo(acls);
100100
}
101+
102+
/**
103+
* Test that the AzureBlobFileSystem close without init works
104+
* @throws Exception if an error occurs
105+
*/
106+
@Test
107+
public void testABFSCloseWithoutInit() throws Exception {
108+
new AzureBlobFileSystem().close();
109+
}
101110
}

0 commit comments

Comments
 (0)