{"record":{"id":"b07127ed9a981e0b","repo":"apache/seatunnel","slug":"snapshot-was-interrupted-before-completion-b07127","errorCode":null,"errorMessage":"Snapshot was interrupted before completion","messagePattern":"Snapshot was interrupted before completion","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-sqlserver/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/sqlserver/source/reader/fetch/scan/SqlServerSnapshotSplitReadTask.java","lineNumber":109,"sourceCode":"\n    @Override\n    public SnapshotResult<SqlServerOffsetContext> execute(\n            ChangeEventSource.ChangeEventSourceContext context,\n            SqlServerPartition partition,\n            SqlServerOffsetContext previousOffset)\n            throws InterruptedException {\n        SnapshottingTask snapshottingTask = getSnapshottingTask(partition, previousOffset);\n        final SnapshotContext<SqlServerPartition, SqlServerOffsetContext> ctx;\n        try {\n            ctx = prepare(partition);\n        } catch (Exception e) {\n            log.error(\"Failed to initialize snapshot context.\", e);\n            throw new RuntimeException(e);\n        }\n        try {\n            return doExecute(context, previousOffset, ctx, snapshottingTask);\n        } catch (InterruptedException e) {\n            log.warn(\"Snapshot was interrupted before completion\");\n            throw e;\n        } catch (Exception t) {\n            throw new DebeziumException(t);\n        }\n    }\n\n    @Override\n    protected SnapshotResult doExecute(\n            ChangeEventSource.ChangeEventSourceContext context,\n            SqlServerOffsetContext previousOffset,\n            SnapshotContext<SqlServerPartition, SqlServerOffsetContext> snapshotContext,\n            AbstractSnapshotChangeEventSource.SnapshottingTask snapshottingTask)\n            throws Exception {\n        final SqlSeverSnapshotContext ctx = (SqlSeverSnapshotContext) snapshotContext;\n        ctx.offset = offsetContext;\n\n        final LsnOffset lowWatermark = SqlServerUtils.currentLsn(jdbcConnection);\n        log.info(","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-sqlserver/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/sqlserver/source/reader/fetch/scan/SqlServerSnapshotSplitReadTask.java#L91-L127","documentation":"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.","triggerScenarios":"SqlServerSnapshotSplitReadTask.execute() is interrupted by engine task cancellation (job stop, checkpoint timeout, failover, shutdown) while streaming the snapshot split.","commonSituations":"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.","solutions":["Expected on intentional job stop — ignore.","If unexpected, find the cancellation root cause in engine logs preceding this warning.","Raise checkpoint timeout / adjust restart strategy so snapshot tasks complete.","Restart the job; snapshot splits resume from saved offsets."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    // run CDC snapshot\n} catch (InterruptedException e) {\n    Thread.currentThread().interrupt();\n    // graceful shutdown; snapshot resumes from checkpoints on restart\n}","preventionTips":["Avoid cancelling jobs during initial snapshot","Increase checkpoint timeout for large SQL Server snapshots","Investigate upstream cancellations (failover, OOM) in engine logs","Keep snapshot restartable via checkpointed offsets"],"tags":["cdc","sqlserver","snapshot","interrupted","job-cancellation"],"backgroundTag":"operation-interrupted","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}