apache/iceberg · warning
Commit operation did not complete within {} minutes ({} ms)
Error message
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. What it means
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.
Source
Thrown at core/src/main/java/org/apache/iceberg/actions/BaseCommitService.java:175
"Cannot get results from a service which has not been closed");
return Lists.newArrayList(committedRewrites.iterator());
}
@Override
public void close() {
Preconditions.checkState(
running.compareAndSet(true, false), "Cannot close already closed commit service");
LOG.info("Closing commit service for {} waiting for all commits to finish", table);
committerService.shutdown();
boolean timeout = false;
try {
// All rewrites have completed and all new files have been created, we are now waiting for
// the commit pool to finish doing its commits to Iceberg State. In the case of partial
// progress this should have been occurring simultaneously with rewrites, if not there should
// be only a single commit operation.
if (!committerService.awaitTermination(timeoutInMS, TimeUnit.MILLISECONDS)) {
LOG.warn(
"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.",
TimeUnit.MILLISECONDS.toMinutes(timeoutInMS),
timeoutInMS);
timeout = true;
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(
"Cannot complete commit for rewrite, commit service interrupted", e);
}
if (!completedRewrites.isEmpty() && timeout) {
LOG.error("Attempting to cleanup uncommitted file groups");
synchronized (completedRewrites) {
while (!completedRewrites.isEmpty()) {
abortFileGroup(completedRewrites.poll());View on GitHub (pinned to 86d9c8fc54)
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.
Example fix
// before
SparkActions.get(spark).rewriteDataFiles(table).execute(); // default timeout too short
// after
table.refresh();
table.updateProperties().set("rewrite.commit-timeout-ms", "1800000").commit();
SparkActions.get(spark).rewriteDataFiles(table).execute(); Defensive patterns
Strategy: retry
Validate before calling
long pending = rewriteGroupCount - committedGroups.get();
if (pending > 0 && committerService.isTerminated()) {
throw new IllegalStateException(pending + " rewritten groups were not committed; re-run the action");
} Try / catch
try (BaseCommitService service = createCommitService()) {
service.close();
} catch (IllegalStateException e) {
LOG.warn("commit service timed out; re-running rewrite will complete remaining groups", e);
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.
Related errors
- Timed out waiting for eviction executor to terminate
- Commit state unknown, cannot clean up files that may have be
- Failed to commit rewrite, cleaning up rewritten files
- [For table {} with {}[{}] at {}]: Exception processing {}
- Cannot commit %s due to unexpected exception
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/3e1993c865104e2d.
Report an issue: GitHub.