yifan-c commented on code in PR #162:
URL: 
https://github.com/apache/cassandra-analytics/pull/162#discussion_r2615423008


##########
cassandra-analytics-core/src/main/java/org/apache/cassandra/spark/bulkwriter/StreamSession.java:
##########
@@ -139,7 +141,16 @@ public Future<StreamResult> finalizeStreamAsync() throws 
IOException
                                  "SSTable range %s should be enclosed in the 
partition range %s",
                                  sstableWriter.getTokenRange(), tokenRange);
         // close the writer before finalizing stream
-        sstableWriter.close(writerContext);
+        try
+        {
+            sstableWriter.close(writerContext);
+        }
+        catch (IOException ioe)
+        {
+            // clean up the sstables and rethrow on I/O errors when closing
+            cleanupSSTables(LOGGER);
+            throw ioe;
+        }

Review Comment:
   @lukasz-antoniak , the clean up is added here. When close is called and 
failed, all `prepareSStablesToSend` scheduled in the future will be no-op and 
it should be safe to remove all sstables eagerly. 



-- 
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