Skip to content

Commit adc79a0

Browse files
authored
HBASE-28448 CompressionTest hangs when run over a Ozone ofs path (#5771)
This bug was found via HDDS-10564.
1 parent 1a089cd commit adc79a0

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/util/CompressionTest.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,18 @@ public static void main(String[] args) throws Exception {
152152

153153
Configuration conf = new Configuration();
154154
Path path = new Path(args[0]);
155-
FileSystem fs = path.getFileSystem(conf);
156-
if (fs.exists(path)) {
157-
System.err.println("The specified path exists, aborting!");
158-
System.exit(1);
159-
}
155+
try (FileSystem fs = path.getFileSystem(conf)) {
156+
if (fs.exists(path)) {
157+
System.err.println("The specified path exists, aborting!");
158+
System.exit(1);
159+
}
160160

161-
try {
162-
doSmokeTest(fs, path, args[1]);
163-
} finally {
164-
fs.delete(path, false);
161+
try {
162+
doSmokeTest(fs, path, args[1]);
163+
} finally {
164+
fs.delete(path, false);
165+
}
166+
System.out.println("SUCCESS");
165167
}
166-
System.out.println("SUCCESS");
167168
}
168169
}

0 commit comments

Comments
 (0)