{"record":{"id":"9787ab891c3c7b07","repo":"apache/iceberg","slug":"suppressing-exception-in-catch-9787ab","errorCode":null,"errorMessage":"Suppressing exception in catch: {}","messagePattern":"Suppressing exception in catch: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/source/RowDataRewriter.java","lineNumber":154,"sourceCode":"    public List<DataFile> map(CombinedScanTask task) throws Exception {\n      // Initialize the task writer.\n      this.writer = taskWriterFactory.create();\n      try (DataIterator<RowData> iterator =\n          new DataIterator<>(rowDataReader, task, io, encryptionManager)) {\n        while (iterator.hasNext()) {\n          RowData rowData = iterator.next();\n          writer.write(rowData);\n        }\n        return Lists.newArrayList(writer.dataFiles());\n      } catch (Throwable originalThrowable) {\n        try {\n          LOG.error(\"Aborting commit for  (subTaskId {}, attemptId {})\", subTaskId, attemptId);\n          writer.abort();\n          LOG.error(\"Aborted commit for  (subTaskId {}, attemptId {})\", subTaskId, attemptId);\n        } catch (Throwable inner) {\n          if (originalThrowable != inner) {\n            originalThrowable.addSuppressed(inner);\n            LOG.warn(\"Suppressing exception in catch: {}\", inner.getMessage(), inner);\n          }\n        }\n\n        if (originalThrowable instanceof Exception) {\n          throw originalThrowable;\n        } else {\n          throw new RuntimeException(originalThrowable);\n        }\n      }\n    }\n  }\n}\n","sourceCodeStart":136,"sourceCodeEnd":167,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/source/RowDataRewriter.java#L136-L167","documentation":"A warning logged in RowDataRewriter.map when, while aborting the writer after a primary failure, the abort itself (or the suppressed-exception bookkeeping) also throws. The inner throwable is attached to the original via addSuppressed and logged rather than replacing the original failure, preserving the root cause.","triggerScenarios":"During close/commit failure inside RowDataRewriter.map, writer.abort() raises a secondary Throwable that differs from originalThrowable, triggering the catch that suppresses and logs it.","commonSituations":"Underlying storage failures (S3/DFS) during commit that then also fail during abort; task cancellation racing cleanup; corrupted open data files preventing abort from deleting them.","solutions":["Inspect the suppressed exception in the log (and the original exception) to fix the root storage/IO problem","If abort failures leave orphan files, run orphan-file cleanup on the table","Check storage credentials/network if abort consistently fails alongside the primary error"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  writer.close();\n} catch (Throwable primary) {\n  try {\n    writer.abort();\n  } catch (Throwable inner) {\n    primary.addSuppressed(inner);\n  }\n  throw primary;\n}","preventionTips":["Ensure storage credentials/permissions allow delete during abort","Run periodic orphan-file cleanup","Inspect suppressed exceptions in logs to find the root cause"],"tags":["flink","cleanup","suppressed-exception","abort"],"backgroundTag":"broken-pipe","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}