Skip to content

Commit 95694dd

Browse files
committed
HBASE-28222 Leak in ExportSnapshot during verifySnapshot on S3A (#5554)
Revert "HBASE-12819 ExportSnapshot doesn't close FileSystem instances" This reverts commit ee32eeb Signed-off-by: Wellington Chevreuil <[email protected]>
1 parent 5915a55 commit 95694dd

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
import org.apache.hadoop.hbase.util.HFileArchiveUtil;
6060
import org.apache.hadoop.hbase.util.Pair;
6161
import org.apache.hadoop.io.BytesWritable;
62-
import org.apache.hadoop.io.IOUtils;
6362
import org.apache.hadoop.io.NullWritable;
6463
import org.apache.hadoop.io.Writable;
6564
import org.apache.hadoop.mapreduce.InputFormat;
@@ -211,14 +210,12 @@ public void setup(Context context) throws IOException {
211210
outputArchive = new Path(outputRoot, HConstants.HFILE_ARCHIVE_DIRECTORY);
212211

213212
try {
214-
srcConf.setBoolean("fs." + inputRoot.toUri().getScheme() + ".impl.disable.cache", true);
215213
inputFs = FileSystem.get(inputRoot.toUri(), srcConf);
216214
} catch (IOException e) {
217215
throw new IOException("Could not get the input FileSystem with root=" + inputRoot, e);
218216
}
219217

220218
try {
221-
destConf.setBoolean("fs." + outputRoot.toUri().getScheme() + ".impl.disable.cache", true);
222219
outputFs = FileSystem.get(outputRoot.toUri(), destConf);
223220
} catch (IOException e) {
224221
throw new IOException("Could not get the output FileSystem with root=" + outputRoot, e);
@@ -241,12 +238,6 @@ public void setup(Context context) throws IOException {
241238
}
242239
}
243240

244-
@Override
245-
protected void cleanup(Context context) {
246-
IOUtils.closeStream(inputFs);
247-
IOUtils.closeStream(outputFs);
248-
}
249-
250241
@Override
251242
public void map(BytesWritable key, NullWritable value, Context context)
252243
throws InterruptedException, IOException {
@@ -990,10 +981,8 @@ public int doWork() throws IOException {
990981
}
991982

992983
Configuration srcConf = HBaseConfiguration.createClusterConf(conf, null, CONF_SOURCE_PREFIX);
993-
srcConf.setBoolean("fs." + inputRoot.toUri().getScheme() + ".impl.disable.cache", true);
994984
FileSystem inputFs = FileSystem.get(inputRoot.toUri(), srcConf);
995985
Configuration destConf = HBaseConfiguration.createClusterConf(conf, null, CONF_DEST_PREFIX);
996-
destConf.setBoolean("fs." + outputRoot.toUri().getScheme() + ".impl.disable.cache", true);
997986
FileSystem outputFs = FileSystem.get(outputRoot.toUri(), destConf);
998987
boolean skipTmp = conf.getBoolean(CONF_SKIP_TMP, false)
999988
|| conf.get(SnapshotDescriptionUtils.SNAPSHOT_WORKING_DIR) != null;
@@ -1149,9 +1138,6 @@ public int doWork() throws IOException {
11491138
}
11501139
outputFs.delete(outputSnapshotDir, true);
11511140
return 1;
1152-
} finally {
1153-
IOUtils.closeStream(inputFs);
1154-
IOUtils.closeStream(outputFs);
11551141
}
11561142
}
11571143

0 commit comments

Comments
 (0)