HDFS-8253. DFSStripedOutputStream.closeThreads releases cellBuffers multiple times. Contributed by Kai Sasaki

This commit is contained in:
Tsz-Wo Nicholas Sze 2015-06-24 23:39:05 +08:00
parent d920cdab91
commit 093907d728
2 changed files with 18 additions and 12 deletions

View File

@ -320,3 +320,6 @@
HDFS-8567. Erasure Coding: SafeMode handles file smaller than a full stripe.
(Walter Su via jing9)
HDFS-8253. DFSStripedOutputStream.closeThreads releases cellBuffers
multiple times. (Kai Sasaki via szetszwo)

View File

@ -494,21 +494,24 @@ public class DFSStripedOutputStream extends DFSOutputStream {
@Override
protected void closeThreads(boolean force) throws IOException {
final MultipleIOException.Builder b = new MultipleIOException.Builder();
for (StripedDataStreamer streamer : streamers) {
try {
streamer.close(force);
streamer.join();
streamer.closeSocket();
} catch(Exception e) {
try {
for (StripedDataStreamer streamer : streamers) {
try {
handleStreamerFailure("force=" + force, e);
} catch(IOException ioe) {
b.add(ioe);
streamer.close(force);
streamer.join();
streamer.closeSocket();
} catch (Exception e) {
try {
handleStreamerFailure("force=" + force, e);
} catch (IOException ioe) {
b.add(ioe);
}
} finally {
streamer.setSocketToNull();
}
} finally {
streamer.setSocketToNull();
setClosed();
}
} finally {
setClosed();
}
final IOException ioe = b.build();
if (ioe != null) {