{"record":{"id":"847b8544dff0d7cf","repo":"apache/iceberg","slug":"cannot-complete-commit-for-rewrite-commit-service","errorCode":null,"errorMessage":"Cannot complete commit for rewrite, commit service interrupted","messagePattern":"Cannot complete commit for rewrite, commit service interrupted","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/actions/BaseCommitService.java","lineNumber":185,"sourceCode":"\n    boolean timeout = false;\n    try {\n      // All rewrites have completed and all new files have been created, we are now waiting for\n      // the commit pool to finish doing its commits to Iceberg State. In the case of partial\n      // progress this should have been occurring simultaneously with rewrites, if not there should\n      // be only a single commit operation.\n      if (!committerService.awaitTermination(timeoutInMS, TimeUnit.MILLISECONDS)) {\n        LOG.warn(\n            \"Commit operation did not complete within {} minutes ({} ms) of the all files \"\n                + \"being rewritten. This may mean that some changes were not successfully committed to the \"\n                + \"table.\",\n            TimeUnit.MILLISECONDS.toMinutes(timeoutInMS),\n            timeoutInMS);\n        timeout = true;\n      }\n    } catch (InterruptedException e) {\n      Thread.currentThread().interrupt();\n      throw new RuntimeException(\n          \"Cannot complete commit for rewrite, commit service interrupted\", e);\n    }\n\n    if (!completedRewrites.isEmpty() && timeout) {\n      LOG.error(\"Attempting to cleanup uncommitted file groups\");\n      synchronized (completedRewrites) {\n        while (!completedRewrites.isEmpty()) {\n          abortFileGroup(completedRewrites.poll());\n        }\n      }\n    }\n\n    Preconditions.checkArgument(\n        !timeout && completedRewrites.isEmpty(),\n        \"Timeout occurred when waiting for commits to complete. \"\n            + \"%s file groups committed. %s file groups remain uncommitted. \"\n            + \"Retry this operation to attempt rewriting the failed groups.\",\n        committedRewrites.size(),","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/actions/BaseCommitService.java#L167-L203","documentation":"Thrown from BaseCommitService.close when awaiting termination of the commit pool fails because the executor was interrupted (distinct from the timeout path, which only logs a warning). Some rewrite commits may not have landed in table state even though all files were written.","triggerScenarios":"Thrown at core/src/main/java/org/apache/iceberg/actions/BaseCommitService.java:185 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the rewrite action: file groups that failed to commit are re-derived and retried","Verify table state (snapshot log) to determine which groups committed before treating output as final","Ensure the commit pool is not interrupted prematurely by job cancellation"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}