apache/seatunnel · warning

Snapshot was interrupted before completion

Error message

Snapshot was interrupted before completion

What it means

SQL Server snapshot split read task logs 'Snapshot was interrupted before completion' (WARN) and rethrows InterruptedException when doExecute() is interrupted during snapshot reading. The snapshot fails due to thread cancellation rather than a data error.

Source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-sqlserver/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/sqlserver/source/reader/fetch/scan/SqlServerSnapshotSplitReadTask.java:109

    @Override
    public SnapshotResult<SqlServerOffsetContext> execute(
            ChangeEventSource.ChangeEventSourceContext context,
            SqlServerPartition partition,
            SqlServerOffsetContext previousOffset)
            throws InterruptedException {
        SnapshottingTask snapshottingTask = getSnapshottingTask(partition, previousOffset);
        final SnapshotContext<SqlServerPartition, SqlServerOffsetContext> 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,
            SqlServerOffsetContext previousOffset,
            SnapshotContext<SqlServerPartition, SqlServerOffsetContext> snapshotContext,
            AbstractSnapshotChangeEventSource.SnapshottingTask snapshottingTask)
            throws Exception {
        final SqlSeverSnapshotContext ctx = (SqlSeverSnapshotContext) snapshotContext;
        ctx.offset = offsetContext;

        final LsnOffset lowWatermark = SqlServerUtils.currentLsn(jdbcConnection);
        log.info(

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Expected on intentional job stop — ignore.
  2. If unexpected, find the cancellation root cause in engine logs preceding this warning.
  3. Raise checkpoint timeout / adjust restart strategy so snapshot tasks complete.
  4. Restart the job; snapshot splits resume from saved offsets.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    // run CDC snapshot
} catch (InterruptedException e) {
    Thread.currentThread().interrupt();
    // graceful shutdown; snapshot resumes from checkpoints on restart
}

Prevention

When it happens

Trigger: SqlServerSnapshotSplitReadTask.execute() is interrupted by engine task cancellation (job stop, checkpoint timeout, failover, shutdown) while streaming the snapshot split.

Common situations: Job cancelled during initial snapshot; Zeta/Flink restart cancels snapshot tasks; long snapshot over big SQL Server tables hitting a checkpoint timeout that triggers cancellation.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/b07127ed9a981e0b. Report an issue: GitHub.