Description
FileUtil.copy() relies on IOUtils.copyBytes() to close the incoming streams, which it does. Normally.
But if dstFS.create() raises any kind of IOException, then the inputstream "in", which was created in the line above, will never get closed, and hence be leaked.
InputStream in = srcFS.open(src);
OutputStream out = dstFS.create(dst, overwrite);
IOUtils.copyBytes(in, out, conf, true);
Some try/catch wrapper around the open operations could close the streams if any exception gets thrown at that point in the copy process.
Attachments
Attachments
Issue Links
- is related to
-
HADOOP-3809 TestCLI fails on trunk point out that moveFromLocal/put output has changed
- Closed