HDFS-10820. Reuse closeResponder to reset the response variable in DataStreamer#run. Contributed by Yiqun Lin.

This commit is contained in:
Xiao Chen 2016-09-01 15:34:47 -07:00
parent 74f4bae455
commit 0690f0969e
1 changed files with 2 additions and 8 deletions

View File

@ -536,14 +536,8 @@ class DataStreamer extends Daemon {
TraceScope scope = null; TraceScope scope = null;
while (!streamerClosed && dfsClient.clientRunning) { while (!streamerClosed && dfsClient.clientRunning) {
// if the Responder encountered an error, shutdown Responder // if the Responder encountered an error, shutdown Responder
if (errorState.hasError() && response != null) { if (errorState.hasError()) {
try { closeResponder();
response.close();
response.join();
response = null;
} catch (InterruptedException e) {
LOG.warn("Caught exception", e);
}
} }
DFSPacket one; DFSPacket one;