{"record":{"id":"7c2be39666035d57","repo":"apache/seatunnel","slug":"interrupted-while-processing-event","errorCode":null,"errorMessage":"Interrupted while processing event ","messagePattern":"Interrupted while processing event ","errorType":"exception","errorClass":"InterruptedException","httpStatus":null,"severity":"info","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/io/debezium/connector/mysql/MySqlSnapshotChangeEventSource.java","lineNumber":670,"sourceCode":"            extends RelationalSnapshotContext<MySqlPartition, MySqlOffsetContext> {\n\n        public MySqlSnapshotContext(MySqlPartition partition) throws SQLException {\n            super(partition, \"\");\n        }\n    }\n\n    @Override\n    protected void createSchemaChangeEventsForTables(\n            ChangeEventSourceContext sourceContext,\n            RelationalSnapshotContext<MySqlPartition, MySqlOffsetContext> snapshotContext,\n            SnapshottingTask snapshottingTask)\n            throws Exception {\n        tryStartingSnapshot(snapshotContext);\n\n        for (Iterator<SchemaChangeEvent> i = schemaEvents.iterator(); i.hasNext(); ) {\n            final SchemaChangeEvent event = i.next();\n            if (!sourceContext.isRunning()) {\n                throw new InterruptedException(\"Interrupted while processing event \" + event);\n            }\n\n            if (databaseSchema.skipSchemaChangeEvent(event)) {\n                continue;\n            }\n\n            LOGGER.debug(\"Processing schema event {}\", event);\n\n            final TableId tableId =\n                    event.getTables().isEmpty() ? null : event.getTables().iterator().next().id();\n            snapshotContext.offset.event(tableId, getClock().currentTime());\n\n            // If data are not snapshotted then the last schema change must set last snapshot flag\n            if (!snapshottingTask.snapshotData() && !i.hasNext()) {\n                lastSnapshotRecord(snapshotContext);\n            }\n            dispatcher.dispatchSchemaChangeEvent(\n                    snapshotContext.partition,","sourceCodeStart":652,"sourceCodeEnd":688,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/io/debezium/connector/mysql/MySqlSnapshotChangeEventSource.java#L652-L688","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  executeCdcJob(config);\n} catch (InterruptedException e) {\n  Thread.currentThread().interrupt();\n  log.info(\"Schema event processing interrupted ({}); snapshot will restart from checkpoint\", e.getMessage());\n}","preventionTips":["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"],"tags":["interrupted","snapshot","cancellation","schema-events","mysql-cdc"],"backgroundTag":"operation-interrupted","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"}