You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "gortiz (via GitHub)" <gi...@apache.org> on 2023/06/05 23:02:40 UTC

[GitHub] [pinot] gortiz commented on a diff in pull request #10847: clean up output files upon exceptions more properly for SegmentProcessorFramework

gortiz commented on code in PR #10847:
URL: https://github.com/apache/pinot/pull/10847#discussion_r1218681132


##########
pinot-core/src/main/java/org/apache/pinot/core/segment/processing/framework/SegmentProcessorFramework.java:
##########
@@ -91,33 +92,51 @@ public SegmentProcessorFramework(List<RecordReader> recordReaders, SegmentProces
    */
   public List<File> process()
       throws Exception {
+    try {
+      return doProcess();
+    } catch (Exception e) {
+      if (_partitionToFileManagerMap != null) {
+        for (GenericRowFileManager fileManager : _partitionToFileManagerMap.values()) {
+          fileManager.cleanUp();
+        }
+      }
+      throw new RuntimeException("Failed to complete process", e);

Review Comment:
   Why changing the exception? you should be able to do `throw e;`



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org