apache/iceberg · error · RuntimeException
Interrupted during commit
Error message
Interrupted during commit
What it means
The commit thread was interrupted while committing the view to the Hive metastore. Iceberg restores the interrupt flag and throws a RuntimeException. Interruption typically comes from task cancellation (e.g. Spark killing a task) or JVM shutdown.
Source
Thrown at hive-metastore/src/main/java/org/apache/iceberg/hive/HiveViewOperations.java:258
newMetadataLocation,
metadata.properties(),
() -> checkCurrentMetadataLocation(newMetadataLocation));
switch (commitStatus) {
case SUCCESS:
break;
case FAILURE:
throw e;
case UNKNOWN:
throw new CommitStateUnknownException(e);
}
}
} catch (TException e) {
throw new RuntimeException(
String.format("Metastore operation failed for %s.%s", database, viewName), e);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException("Interrupted during commit", e);
} catch (LockException e) {
throw new CommitFailedException(e);
} finally {
HiveOperationsBase.cleanupMetadataAndUnlock(io(), commitStatus, newMetadataLocation, lock);
}
LOG.info(
"Committed to view {} with the new metadata location {}", fullName, newMetadataLocation);
}
/**
* Validate if the new metadata location is the current metadata location.
*
* @param newMetadataLocation newly written metadata location
* @return true if the new metadata location is the current metadata location
*/View on GitHub (pinned to 86d9c8fc54)
Solutions
- Find what interrupted the thread (task cancellation, shutdown hook) and avoid cancelling during commits.
- Re-run the write after cancellation; check whether the commit landed (commit state may be uncertain).
- If commit state is ambiguous, verify the current metadata location in the metastore before re-committing.
Defensive patterns
Strategy: try-catch
Try / catch
try {
view.updateSQL()...commit();
} catch (RuntimeException e) {
if (e.getMessage() != null && e.getMessage().contains("Interrupted during commit")) {
Thread.interrupted(); // decide policy; check whether the commit actually landed
}
throw e;
} Prevention
- Avoid cancelling Spark/Flink tasks in the middle of commits.
- Size job timeouts so commits are not interrupted by orchestration kill signals.
- After an interruption, verify the metastore's metadata_location before re-committing.
When it happens
Trigger: Thread interrupted (Thread.interrupt) during doCommit's metastore calls or lock acquisition; Spark/Flink task cancellation; executor shutdown mid-commit.
Common situations: Spark speculative execution or stage cancellation during a write; application shutdown with in-flight commits; timeouts in orchestration frameworks that cancel tasks.
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
- Interrupted while trying to find lock for table %s.%s
- Interrupted while creating lock on table %s.%s
- Interrupted in SQL query
- Interrupted during commit
- Interrupted while waiting for array pool entry
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/0fa8a5df1197ad1d.
Report an issue: GitHub.