sodonnel commented on code in PR #4269:
URL: https://github.com/apache/ozone/pull/4269#discussion_r1104368480


##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java:
##########
@@ -487,23 +490,23 @@ public void close() throws IOException {
     }
     closed = true;
     try {
-      // If stripe buffer is not empty, encode and flush the stripe.
-      if (ecChunkBufferCache.getFirstDataCell().position() > 0) {
-        generateParityCells();
-        addStripeToQueue(ecChunkBufferCache);
-      }
-      // Send EOF mark to flush thread.
-      addStripeToQueue(new EOFDummyStripe());
+      if (!closing) {

Review Comment:
   I wonder if we should still at least try to flush the "stripeQueue" even if 
the state is closing = true?
   
   When we do writes, the stripe gets buffered in the queue, so there might be 
some buffered data ready to write out. However closing = true is an error 
state, indicating something unexpected happened during a previous write, so the 
completeness of the current stripe buffer may not be known or good.
   
   I am not 100% sure what the best approach is - trying to write out the 
buffered data could run into problems too, due to the same exception that 
caused the stream to go into the closing state.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to