{"record":{"id":"44c782b19baa9e53","repo":"apache/iceberg","slug":"for-table-with-at-exception-closin-44c782","errorCode":null,"errorMessage":"[For table {} with {}[{}] at {}]: Exception closing commit service","messagePattern":"\\[For table (.+?) with (.+?)\\[(.+?)\\] at (.+?)\\]: Exception closing commit service","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/DataFileRewriteCommitter.java","lineNumber":145,"sourceCode":"      errorCounter.inc();\n    }\n  }\n\n  @Override\n  public void processWatermark(Watermark mark) throws Exception {\n    try {\n      if (commitService != null) {\n        commitService.close();\n      }\n\n      LOG.info(\n          DataFileRewritePlanner.MESSAGE_PREFIX + \"Successfully completed data file compaction\",\n          tableName,\n          taskName,\n          taskIndex,\n          mark.getTimestamp());\n    } catch (Exception e) {\n      LOG.warn(\n          DataFileRewritePlanner.MESSAGE_PREFIX + \"Exception closing commit service\",\n          tableName,\n          taskName,\n          taskIndex,\n          mark.getTimestamp(),\n          e);\n      output.collect(TaskResultAggregator.ERROR_STREAM, new StreamRecord<>(e));\n      errorCounter.inc();\n    }\n\n    // Cleanup\n    this.commitService = null;\n\n    super.processWatermark(mark);\n  }\n\n  @Override\n  public void close() throws IOException {","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/DataFileRewriteCommitter.java#L127-L163","documentation":"This is a warning logged by DataFileRewriteCommitter.processWatermark in Iceberg's Flink maintenance (rewrite data files) flow when the rewrite commit service fails to close after a completed compaction. It is not a compaction failure itself; the commit already happened or was attempted, but the underlying service/executor (RewriteDataFilesCommitService) threw during close, typically meaning some commit resources or threads could not be shut down cleanly. Iceberg logs it with the table/task context instead of failing the Flink checkpoint.","triggerScenarios":"Triggered in DataFileRewriteCommitter.processWatermark when closeService() (closing the RewriteDataFilesCommitService after collecting rewrite results) throws any Exception — e.g. an underlying commit failure surfaced on close, thread interruption while shutting the executor, or IOException releasing FileIO resources.","commonSituations":"Table metadata changed concurrently between planning and commit (schema/spec update or another compaction job committing), causing commitInsideService failures that surface during close; TaskManager thread interruption at checkpoint boundaries; slow ObjectStore FileIO close timeouts.","solutions":["Check the nested cause 'e' in the log for the real failure (often ValidationException from a conflicting commit) and re-run the rewrite when the table is quiescent","Ensure only one rewrite/maintenance job runs against the table at a time to avoid concurrent-commit conflicts","Retry the maintenance job; if transient thread interruption, verify TaskManager shutdown/checkpoint settings","If persistent, inspect FileIO close behavior for the configured object store and its timeouts"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Library-side; user monitors logs/alerts on MESSAGE_PREFIX + 'Exception closing commit service'\nif (logMessage.contains(\"Exception closing commit service\")) { alertMaintenanceFailure(tableName); scheduleRewriteRetry(); }","preventionTips":["Run a single rewrite job per table to avoid concurrent-commit conflicts","Check the logged cause for ValidationException and re-run when the table is quiescent","Alert on this log line rather than failing the job — the checkpoint still proceeds"],"tags":["flink","maintenance","compaction","commit"],"backgroundTag":"invalid-state-transition","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}