{"record":{"id":"3e1993c865104e2d","repo":"apache/iceberg","slug":"commit-operation-did-not-complete-within-minute","errorCode":null,"errorMessage":"Commit operation did not complete within {} minutes ({} ms) of the all files being rewritten. This may mean that some changes were not successfully committed to the table.","messagePattern":"Commit operation did not complete within (.+?) minutes \\((.+?) ms\\) of the all files being rewritten\\. This may mean that some changes were not successfully committed to the table\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"core/src/main/java/org/apache/iceberg/actions/BaseCommitService.java","lineNumber":175,"sourceCode":"        \"Cannot get results from a service which has not been closed\");\n    return Lists.newArrayList(committedRewrites.iterator());\n  }\n\n  @Override\n  public void close() {\n    Preconditions.checkState(\n        running.compareAndSet(true, false), \"Cannot close already closed commit service\");\n    LOG.info(\"Closing commit service for {} waiting for all commits to finish\", table);\n    committerService.shutdown();\n\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());","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/actions/BaseCommitService.java#L157-L193","documentation":"BaseCommitService.close() waits for the commit thread pool to finish committing rewritten files. If the pool does not terminate within the configured timeout after all rewrite tasks completed, this warning is logged and a timeout flag is set. It means some rewritten file groups may not have been committed to the Iceberg table, i.e. the rewrite result is partial.","triggerScenarios":"The commit executor service does not reach termination within timeoutInMS (rewrite.commit-timeout-ms or the action's configured timeout) after all rewrites finish in a RewriteDataFiles action run.","commonSituations":"Very large rewrites with many file groups; slow catalog commits (high contention, throttled object store); too-small commit thread pool; commit-timeout-ms set too low; partial-progress mode stalled by a few failing commits.","solutions":["Increase the rewrite commit timeout property (e.g. rewrite.commit-timeout-ms) and re-run the action.","Reduce parallelism or file-group size so commits complete faster, or increase the commit pool size.","Check catalog/object store latency and contention; resolve throttling or concurrent-writer conflicts.","Re-run the RewriteDataFiles action — already-rewritten groups are skipped and remaining groups get committed.","Verify table state with snapshots to see which rewrites actually landed."],"exampleFix":"// before\nSparkActions.get(spark).rewriteDataFiles(table).execute(); // default timeout too short\n// after\ntable.refresh();\ntable.updateProperties().set(\"rewrite.commit-timeout-ms\", \"1800000\").commit();\nSparkActions.get(spark).rewriteDataFiles(table).execute();","handlingStrategy":"retry","validationCode":"long pending = rewriteGroupCount - committedGroups.get();\nif (pending > 0 && committerService.isTerminated()) {\n  throw new IllegalStateException(pending + \" rewritten groups were not committed; re-run the action\");\n}","typeGuard":null,"tryCatchPattern":"try (BaseCommitService service = createCommitService()) {\n  service.close();\n} catch (IllegalStateException e) {\n  LOG.warn(\"commit service timed out; re-running rewrite will complete remaining groups\", e);\n}","preventionTips":["Set rewrite.commit-timeout-ms generously for large rewrites","Size the commit thread pool for catalog throughput","Minimize concurrent table writers during rewrites","Re-run failed rewrites; completed groups are skipped"],"tags":["timeout","rewrite","commit","thread-pool"],"backgroundTag":"request-timeout","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"}