{"record":{"id":"8520a36e3276f84a","repo":"apache/seatunnel","slug":"snapshot-was-interrupted-before-completion","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-db2/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/db2/source/reader/fetch/scan/Db2SnapshotSplitReadTask.java","lineNumber":109,"sourceCode":"\n    @Override\n    public SnapshotResult<Db2OffsetContext> execute(\n            ChangeEventSource.ChangeEventSourceContext context,\n            Db2Partition partition,\n            Db2OffsetContext previousOffset)\n            throws InterruptedException {\n        SnapshottingTask snapshottingTask = getSnapshottingTask(partition, previousOffset);\n        final SnapshotContext<Db2Partition, Db2OffsetContext> 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            Db2OffsetContext previousOffset,\n            SnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext,\n            AbstractSnapshotChangeEventSource.SnapshottingTask snapshottingTask)\n            throws Exception {\n        final Db2SnapshotContext ctx = (Db2SnapshotContext) snapshotContext;\n        ctx.offset = offsetContext;\n\n        final LsnOffset lowWatermark = Db2Utils.currentLsn(jdbcConnection);\n        log.info(","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-db2/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/db2/source/reader/fetch/scan/Db2SnapshotSplitReadTask.java#L91-L127","documentation":"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.","triggerScenarios":"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.","commonSituations":"Long-running DB2 snapshot exceeding checkpoint timeout; engine failover interrupting tasks; user cancelling a job mid-snapshot; resource manager killing/restarting workers.","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."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-check: snapshot size vs checkpoint timeout\n// estimate table rows: SELECT COUNT(*) FROM ...; ensure checkpoint.timeout >> snapshot time","typeGuard":null,"tryCatchPattern":"try {\n    task.execute(ctx);\n} catch (InterruptedException e) {\n    Thread.currentThread().interrupt();\n    // restore from checkpoint / retry split rather than failing outright\n}","preventionTips":["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"],"tags":["cdc","db2","snapshot","interrupted"],"backgroundTag":"request-timeout","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}