apache/seatunnel · warning
Snapshot was interrupted before completion
Error message
Snapshot was interrupted before completion
What it means
Db2SnapshotSplitReadTask.execute() runs the snapshot read for a DB2 split. If the snapshot thread is interrupted while executing doExecute (task cancelled, checkpoint timeout/failure, or job shutdown), it logs this warning and rethrows InterruptedException instead of wrapping it in DebeziumException. It signals the snapshot did not finish and will be retried or fail the task.
Source
Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-db2/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/db2/source/reader/fetch/scan/Db2SnapshotSplitReadTask.java:109
@Override
public SnapshotResult<Db2OffsetContext> execute(
ChangeEventSource.ChangeEventSourceContext context,
Db2Partition partition,
Db2OffsetContext previousOffset)
throws InterruptedException {
SnapshottingTask snapshottingTask = getSnapshottingTask(partition, previousOffset);
final SnapshotContext<Db2Partition, Db2OffsetContext> ctx;
try {
ctx = prepare(partition);
} catch (Exception e) {
log.error("Failed to initialize snapshot context.", e);
throw new RuntimeException(e);
}
try {
return doExecute(context, previousOffset, ctx, snapshottingTask);
} catch (InterruptedException e) {
log.warn("Snapshot was interrupted before completion");
throw e;
} catch (Exception t) {
throw new DebeziumException(t);
}
}
@Override
protected SnapshotResult doExecute(
ChangeEventSource.ChangeEventSourceContext context,
Db2OffsetContext previousOffset,
SnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext,
AbstractSnapshotChangeEventSource.SnapshottingTask snapshottingTask)
throws Exception {
final Db2SnapshotContext ctx = (Db2SnapshotContext) snapshotContext;
ctx.offset = offsetContext;
final LsnOffset lowWatermark = Db2Utils.currentLsn(jdbcConnection);
log.info(View on GitHub (pinned to cf67b549a7)
Solutions
- Check whether this occurred during an intentional cancel/failover — if so, rerun/resume the job from checkpoint; the log is expected.
- Increase checkpoint interval/timeout so long snapshots aren't interrupted (e.g. bigger 'checkpoint.timeout' in job config).
- Speed up the snapshot (raise reader parallelism, tune DB2 fetch size) so it completes within the window.
- Verify cluster stability (no repeated worker restarts) and retry the job.
- If interruption is spurious, inspect upstream task manager logs for the interrupting failure and fix that root cause first.
Defensive patterns
Strategy: retry
Validate before calling
// pre-check: snapshot size vs checkpoint timeout // estimate table rows: SELECT COUNT(*) FROM ...; ensure checkpoint.timeout >> snapshot time
Try / catch
try {
task.execute(ctx);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
// restore from checkpoint / retry split rather than failing outright
} Prevention
- Set checkpoint timeout larger than the longest table snapshot
- Parallelize/chunk big tables to shorten snapshot duration
- Avoid cancelling jobs mid-snapshot; wait for completion or use stop-with-savepoint
- Ensure cluster stability to avoid failovers during snapshot
When it happens
Trigger: Interruption of the snapshot-fetch thread during doExecute — typically job cancellation, task restart after failure, or engine-initiated interruption (checkpoint timeout, failover) while the DB2 snapshot query/cursor loop is still running.
Common situations: Long-running DB2 snapshot exceeding checkpoint timeout; engine failover interrupting tasks; user cancelling a job mid-snapshot; resource manager killing/restarting workers.
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
- Read snapshot for split %s fail
- Snapshotting of table failed
- Snapshot was interrupted before completion
- 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/8520a36e3276f84a.
Report an issue: GitHub.