apache/iceberg · error · ConnectException
Interrupted while waiting for coordinator shutdown
Error message
Interrupted while waiting for coordinator shutdown
What it means
Coordinator.terminate()'s awaitTermination(1, TimeUnit.MINUTES) can throw InterruptedException if the thread waiting for the coordinator to shut down is itself interrupted; it is rethrown as ConnectException with the interrupted thread chained as the cause so shutdown failure surfaces clearly.
Source
Thrown at kafka-connect/kafka-connect/src/main/java/org/apache/iceberg/connect/channel/Coordinator.java:440
}
}
long partialCommitFailureCount() {
return partialCommitFailures.get();
}
void terminate() {
this.terminated = true;
exec.shutdownNow();
// wait for coordinator termination, else cause the sink task to fail
try {
if (!exec.awaitTermination(1, TimeUnit.MINUTES)) {
throw new ConnectException("Timed out waiting for coordinator shutdown");
}
} catch (InterruptedException e) {
throw new ConnectException("Interrupted while waiting for coordinator shutdown", e);
}
}
}
View on GitHub (pinned to 86d9c8fc54)
Solutions
- Inspect the chained cause to identify which thread was interrupted and why Connect issued the interrupt.
- Check the earlier shutdown attempt — a prior timeout usually precedes the interrupt; address the underlying coordinator hang.
- Ensure the coordinator completes promptly (fix slow catalog access, large commits) so terminate() finishes before Connect escalates to interrupts.
- If this appears in logs during connector deletion or forced task kill, it is expected escalation; no code change needed.
Defensive patterns
Strategy: try-catch
Try / catch
try {
coordinator.stop(true);
} catch (ConnectException e) {
if (e.getCause() instanceof InterruptedException) {
Thread.currentThread().interrupt(); // preserve interrupt status
LOG.warn("Interrupted while awaiting coordinator shutdown (task cancellation)", e);
} else {
throw e;
}
} Prevention
- Fix prior shutdown timeouts — interrupts are Connect's escalation after them
- Avoid frequent connector restart/cancel churn during commit windows
- Always restore the thread interrupt flag when catching InterruptedException in wrappers
When it happens
Trigger: The thread calling Coordinator.terminate() (a Kafka Connect worker thread) receives an interrupt — usually because Connect is force-stopping the task after a prior shutdown timeout or during connector/task cancellation.
Common situations: Connect task cancellation cascades: first a timeout, then an interrupt while a second shutdown attempt waits; task.restart during rebalance interrupting the in-progress terminate() call.
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 coordinator shutdown
- Interrupted in call to initialize
- Coordinator unexpectedly terminated on committer ${taskId}
- Coordinator ${taskId} is terminated, commit aborted
- An error occurred closing catalog instance, ignoring...
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/e6f40b179cb54ce9.
Report an issue: GitHub.