apache/seatunnel · info · InterruptedException
Interrupted while processing event
Error message
Interrupted while processing event
What it means
createSchemaChangeEventsForTables replays the collected schema-change events (CREATE/DROP/ALTER collected during snapshot) through the schema history. Before dispatching each event it checks sourceContext.isRunning(); if the task has been stopped, cancelled, or its thread interrupted between events, it throws InterruptedException with the offending event in the message. Like [455], this is cooperative cancellation during the snapshot phase.
Source
Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/io/debezium/connector/mysql/MySqlSnapshotChangeEventSource.java:670
extends RelationalSnapshotContext<MySqlPartition, MySqlOffsetContext> {
public MySqlSnapshotContext(MySqlPartition partition) throws SQLException {
super(partition, "");
}
}
@Override
protected void createSchemaChangeEventsForTables(
ChangeEventSourceContext sourceContext,
RelationalSnapshotContext<MySqlPartition, MySqlOffsetContext> snapshotContext,
SnapshottingTask snapshottingTask)
throws Exception {
tryStartingSnapshot(snapshotContext);
for (Iterator<SchemaChangeEvent> i = schemaEvents.iterator(); i.hasNext(); ) {
final SchemaChangeEvent event = i.next();
if (!sourceContext.isRunning()) {
throw new InterruptedException("Interrupted while processing event " + event);
}
if (databaseSchema.skipSchemaChangeEvent(event)) {
continue;
}
LOGGER.debug("Processing schema event {}", event);
final TableId tableId =
event.getTables().isEmpty() ? null : event.getTables().iterator().next().id();
snapshotContext.offset.event(tableId, getClock().currentTime());
// If data are not snapshotted then the last schema change must set last snapshot flag
if (!snapshottingTask.snapshotData() && !i.hasNext()) {
lastSnapshotRecord(snapshotContext);
}
dispatcher.dispatchSchemaChangeEvent(
snapshotContext.partition,View on GitHub (pinned to cf67b549a7)
Solutions
- If the stop was intentional, no action needed; the snapshot restarts from its recorded offset/checkpoint on next start.
- Inspect preceding logs for the actual cancellation cause (job cancel, task failure, checkpoint timeout) and address that root cause.
- Speed up snapshot/schema phase (fewer included tables, faster connection to MySQL) to shrink the cancellation window.
- If the connector keeps getting restarted by the framework, fix the underlying restart trigger (e.g. checkpoint failures) rather than this symptom.
Defensive patterns
Strategy: try-catch
Try / catch
try {
executeCdcJob(config);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.info("Schema event processing interrupted ({}); snapshot will restart from checkpoint", e.getMessage());
} Prevention
- Don't stop/cancel jobs mid-snapshot; wait for snapshot completion
- Include fewer tables so the schema phase completes faster
- Investigate repeated engine-driven task restarts (checkpoint failures) that interrupt the snapshot thread
- Monitor task lifecycle events to correlate interruptions with restarts
When it happens
Trigger: While iterating the schemaEvents iterator, a call to sourceContext.isRunning() returns false or the snapshot thread's interrupt flag is set — i.e. the job/task was cancelled, restarted, or failed over between emitting schema events.
Common situations: Cancelling the SeaTunnel job while the snapshot's schema replay is in progress; task failover mid-snapshot; operator stopping the job after noticing a misconfiguration; large numbers of tables making schema-event processing slow enough that stops land in this loop.
Related errors
- Interrupted while reading structure of schema
- Failed to get connection, interrupted while doing another at
- Interrupted while emitting initial DROP TABLE events
- Snapshot was interrupted before completion
- Snapshot was interrupted before completion
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/7c2be39666035d57.
Report an issue: GitHub.