{"record":{"id":"af471df0a365192e","repo":"apache/seatunnel","slug":"thread-interrupted-af471d","errorCode":null,"errorMessage":"Thread interrupted","messagePattern":"Thread interrupted","errorType":"exception","errorClass":"InterruptedException","httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/yashandb/YashanDbDialect.java","lineNumber":330,"sourceCode":"        } else {\n            sampleQuery =\n                    String.format(\n                            \"SELECT %s FROM %s\",\n                            quoteIdentifier(columnName), tableIdentifier(table.getTablePath()));\n        }\n\n        try (PreparedStatement stmt = creatPreparedStatement(connection, sampleQuery, fetchSize)) {\n            try (ResultSet rs = stmt.executeQuery()) {\n                int count = 0;\n                List<Object> results = new ArrayList<>();\n\n                while (rs.next()) {\n                    count++;\n                    if (count % samplingRate == 0) {\n                        results.add(rs.getObject(1));\n                    }\n                    if (Thread.currentThread().isInterrupted()) {\n                        throw new InterruptedException(\"Thread interrupted\");\n                    }\n                }\n                Object[] resultsArray = results.toArray();\n                Arrays.sort(resultsArray);\n                return resultsArray;\n            }\n        }\n    }\n\n    @Override\n    public void applySchemaChange(\n            Connection connection, TablePath tablePath, AlterTableAddColumnEvent event)\n            throws SQLException {\n        List<String> ddlSQL = new ArrayList<>();\n        ddlSQL.add(buildUpdateColumnSQL(connection, tablePath, event));\n\n        if (event.getColumn().getComment() != null) {\n            ddlSQL.add(buildUpdateColumnCommentSQL(tablePath, event.getColumn()));","sourceCodeStart":312,"sourceCodeEnd":348,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/yashandb/YashanDbDialect.java#L312-L348","documentation":"Thrown by YashanDbDialect.sampleDataFromColumn when the sampling loop detects the worker thread has been interrupted while streaming sampled values from the split column. Sampling is aborted via InterruptedException so the framework can shut the task down cleanly.","triggerScenarios":"A job cancel, checkpoint/timeout, or task failure interrupts the thread while ResultSet iteration over the sampling query is in progress.","commonSituations":"User cancels a job during the split-sampling phase; coordinator timeout interrupts slow sampling on large tables; worker shutdown/restart.","solutions":["No fix needed — this is a cooperative cancellation; re-run the job if the cancel was unintentional","Speed up sampling by reducing sampling rate or adding a WHERE filter on the split column so it finishes before timeouts","Increase job/task timeout settings if sampling on very large tables is legitimately slow","Avoid frequent manual cancellations during split computation"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// No pre-check possible; instead ensure generous timeouts so sampling completes\n// and avoid cancelling during split computation","typeGuard":null,"tryCatchPattern":"try {\n    runJob();\n} catch (InterruptedException e) {\n    Thread.currentThread().interrupt(); // preserve interrupt status and re-run if needed\n} catch (Exception e) {\n    if (e.getCause() instanceof InterruptedException) { /* job was cancelled during sampling */ }\n}","preventionTips":["Do not cancel jobs mid split-computation unless intended","Add WHERE filters or lower sampling rate to speed sampling on large tables","Increase task timeout for very large split sampling","Ensure workers are not restarted during split enumeration"],"tags":["jdbc","yashandb","interruption","split-reading"],"backgroundTag":"thread-interrupted","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}