apache/seatunnel · warning · DebeziumException
Interrupted while dispatching PostgreSQL relation change for
Error message
Interrupted while dispatching PostgreSQL relation change for ${table.id()} What it means
dispatchRelationSchemaChange enqueues a schema-change (RELATION) event onto the fetch task's change-event queue. If the enqueue is interrupted (thread interrupted while blocked on a full/closed queue), the thread's interrupt flag is restored and a DebeziumException 'Interrupted while dispatching...' is thrown, aborting the fetch task.
Source
Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/source/reader/PostgresSourceFetchTaskContext.java:371
if (previousRelation != null
&& RelationAwarePostgresSchema.hasSameRelationSchema(previousRelation, table)) {
return;
}
if (previousRelation == null && hasSameBaselineSchema(table)) {
return;
}
SourceRecord record =
PostgresRelationSchemaRecord.create(
table,
partition.getSourcePartition(),
new HashMap<>(offsetContext.getOffset()),
topicSelector.topicNameFor(table.id()));
try {
queue.enqueue(new DataChangeEvent(record));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new DebeziumException(
"Interrupted while dispatching PostgreSQL relation change for " + table.id(),
e);
}
}
/** Compare the first RELATION for a table with initial or checkpoint-restored catalog state. */
private boolean hasSameBaselineSchema(Table relation) {
return relationSchemaBaseline.stream()
.filter(
table ->
Objects.equals(
table.getTablePath().getSchemaName(),
PostgresRelationSchemaChangeResolver
.relationSchemaName(relation))
&& Objects.equals(
table.getTablePath().getTableName(),
relation.id().table()))
.findFirst()View on GitHub (pinned to cf67b549a7)
Solutions
- Usually expected during job shutdown — restart/resubmit the job; the schema change will be re-read from the slot.
- If it occurs under normal load, increase reader queue capacity or slow the upstream DDL churn.
- Investigate what interrupted the thread (cancellation, timeout, failover) from surrounding logs.
- Ensure checkpointing is enabled so the task can resume from the last committed LSN.
Defensive patterns
Strategy: try-catch
Try / catch
try {
fetchTask.run();
} catch (DebeziumException e) {
if (e.getMessage().startsWith("Interrupted while dispatching")) {
// expected during shutdown/cancel: resubmit or ignore
Thread.currentThread().interrupt();
} else {
throw e;
}
} Prevention
- Avoid aggressive cancellation of jobs mid-DDL
- Size reader queues to absorb schema-change bursts
- Enable checkpointing for clean resume after interruption
When it happens
Trigger: The queue's enqueue blocks (downstream consumer stopped or slow, task being cancelled/shutdown) and the worker thread is interrupted during that wait.
Common situations: Job cancellation or failover interrupting reader threads while a DDL event is being dispatched; backpressure causing the queue to fill at the moment of shutdown; checkpoint/restore race conditions.
Understand the failure class
Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.
Related errors
- PostgreSQL-CDC schema evolution requires 'decoding.plugin.na
- INVALID_SCHEMA_STRUCTURE
- Thread interrupted
- Interrupted while emitting initial DROP TABLE events
- Thread interrupted
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/d36b90eabbd80bf3.
Report an issue: GitHub.