{"record":{"id":"d56c37483f438820","repo":"apache/seatunnel","slug":"thread-interrupted-d56c37","errorCode":null,"errorMessage":"Thread interrupted","messagePattern":"Thread interrupted","errorType":"exception","errorClass":"InterruptedException","httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/oracle/utils/OracleUtils.java","lineNumber":196,"sourceCode":"            stmt =\n                    jdbc.connection()\n                            .createStatement(\n                                    ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);\n\n            stmt.setFetchSize(DEFAULT_FETCH_SIZE);\n            rs = stmt.executeQuery(sampleQuery);\n\n            int count = 0;\n            while (rs.next()) {\n                count++;\n                if (count % 100000 == 0) {\n                    log.info(\"Processing row index: {}\", count);\n                }\n                if (count % inverseSamplingRate == 0) {\n                    results.add(rs.getObject(1));\n                }\n                if (Thread.currentThread().isInterrupted()) {\n                    throw new InterruptedException(\"Thread interrupted\");\n                }\n            }\n        } finally {\n            if (rs != null) {\n                try {\n                    rs.close();\n                } catch (SQLException e) {\n                    log.error(\"Failed to close ResultSet\", e);\n                }\n            }\n            if (stmt != null) {\n                try {\n                    stmt.close();\n                } catch (SQLException e) {\n                    log.error(\"Failed to close Statement\", e);\n                }\n            }\n        }","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/oracle/utils/OracleUtils.java#L178-L214","documentation":"Thrown by OracleUtils.skipReadAndSortSampleData when the sampling thread detects it has been interrupted (Thread.interrupted()). It is an InterruptedException used to abort long-running sample-data reads promptly during snapshot cancellation or task shutdown.","triggerScenarios":"The snapshot task is cancelled/fails over while the sampler is streaming and sorting sampled rows; Zeta/Flink sends an interrupt to stop the task; job restart or checkpoint timeout leads to task interruption during the sampling loop.","commonSituations":"Job cancelled by user; worker node failure triggering task restart; slow sampling of huge tables making interruption likely during shutdown; checkpoint timeout aborting the task mid-sample.","solutions":["Treat as expected during cancellation: rerun/restart the job; snapshot will retry.","If it happens repeatedly at start, check for frequent task restarts (OOM, checkpoint timeouts) and fix the root cause.","Reduce sampling cost on very large tables (adjust sampling rate/inverseSamplingRate) so the phase finishes faster.","Check job manager logs for the initiating cancel/interrupt to identify the upstream failure."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    OracleUtils.skipReadAndSortSampleData(jdbc, tableId, columnName, ...);\n} catch (InterruptedException e) {\n    Thread.currentThread().interrupt(); // restore flag\n    LOG.info(\"sampling aborted due to task cancellation\");\n    return Collections.emptyList();\n}","preventionTips":["Expect interruption during cancel/failover — treat as normal shutdown","Fix root causes of frequent task restarts (OOM, checkpoint timeout)","Tune sampling rate on very large tables to shorten the phase"],"tags":["oracle","cdc","interruption","sampling"],"backgroundTag":"thread-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"}