@@ -1781,6 +1781,7 @@ class DataStreamer extends Daemon {
blockStream = out;
result = true; // success
errorState.resetInternalError();
+ lastException.clear();
// remove all restarting nodes from failed nodes list
failed.removeAll(restartingNodes);
restartingNodes.clear();
@@ -436,6 +436,8 @@ public class TestClientProtocolForPipelineRecovery {
0, out.getStreamer().getPipelineRecoveryCount());
out.write(1);
out.close();
+ // Ensure that subsequent closes are idempotent and do not throw errors
+ out.close();
} finally {
if (cluster != null) {
cluster.shutdown();