Skip to content

Commit 0f34724

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 <wchevreuil@apache.org>
1 parent 0f63885 commit 0f34724

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;
@@ -209,14 +208,12 @@ public void setup(Context context) throws IOException {
209208
outputArchive = new Path(outputRoot, HConstants.HFILE_ARCHIVE_DIRECTORY);
210209

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

218216
try {
219-
destConf.setBoolean("fs." + outputRoot.toUri().getScheme() + ".impl.disable.cache", true);
220217
outputFs = FileSystem.get(outputRoot.toUri(), destConf);
221218
} catch (IOException e) {
222219
throw new IOException("Could not get the output FileSystem with root=" + outputRoot, e);
@@ -238,12 +235,6 @@ public void setup(Context context) throws IOException {
238235
}
239236
}
240237

241-
@Override
242-
protected void cleanup(Context context) {
243-
IOUtils.closeStream(inputFs);
244-
IOUtils.closeStream(outputFs);
245-
}
246-
247238
@Override
248239
public void map(BytesWritable key, NullWritable value, Context context)
249240
throws InterruptedException, IOException {
@@ -987,10 +978,8 @@ public int doWork() throws IOException {
987978
}
988979

989980
Configuration srcConf = HBaseConfiguration.createClusterConf(conf, null, CONF_SOURCE_PREFIX);
990-
srcConf.setBoolean("fs." + inputRoot.toUri().getScheme() + ".impl.disable.cache", true);
991981
FileSystem inputFs = FileSystem.get(inputRoot.toUri(), srcConf);
992982
Configuration destConf = HBaseConfiguration.createClusterConf(conf, null, CONF_DEST_PREFIX);
993-
destConf.setBoolean("fs." + outputRoot.toUri().getScheme() + ".impl.disable.cache", true);
994983
FileSystem outputFs = FileSystem.get(outputRoot.toUri(), destConf);
995984
boolean skipTmp = conf.getBoolean(CONF_SKIP_TMP, false)
996985
|| conf.get(SnapshotDescriptionUtils.SNAPSHOT_WORKING_DIR) != null;
@@ -1146,9 +1135,6 @@ public int doWork() throws IOException {
11461135
}
11471136
outputFs.delete(outputSnapshotDir, true);
11481137
return 1;
1149-
} finally {
1150-
IOUtils.closeStream(inputFs);
1151-
IOUtils.closeStream(outputFs);
11521138
}
11531139
}
11541140

0 commit comments

Comments
 (0)