apache/seatunnel · warning · InterruptedException
Thread interrupted
Error message
Thread interrupted
What it means
Db2Utils.skipReadAndSortSampleData samples column values for chunk splitting and checks Thread interruption inside the result loop. When the worker thread is interrupted (task cancelled or checkpoint/closure), it throws InterruptedException('Thread interrupted') to stop sampling promptly.
Source
Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-db2/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/db2/utils/Db2Utils.java:177
stmt =
jdbc.connection()
.createStatement(
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
stmt.setFetchSize(1024);
rs = stmt.executeQuery(sampleQuery);
int count = 0;
while (rs.next()) {
count++;
if (count % 100000 == 0) {
log.info("Processing row index: {}", count);
}
if (count % inverseSamplingRate == 0) {
results.add(rs.getObject(1));
}
if (Thread.currentThread().isInterrupted()) {
throw new InterruptedException("Thread interrupted");
}
}
} finally {
if (rs != null) {
try {
rs.close();
} catch (SQLException e) {
log.error("Failed to close ResultSet", e);
}
}
if (stmt != null) {
try {
stmt.close();
} catch (SQLException e) {
log.error("Failed to close Statement", e);
}
}
}View on GitHub (pinned to cf67b549a7)
Solutions
- No fix needed if you intentionally cancelled the job — this is expected cleanup
- If unexpected, check job manager logs for the original cancellation/shutdown cause
- Retry the job; sampling will restart
- Reduce table size or use non-sampling chunk strategy to shorten the interruption window
Defensive patterns
Strategy: try-catch
Try / catch
try { Db2Utils.skipReadAndSortSampleData(...); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); /* expected on cancel: exit sampling and restore interrupt flag */ } Prevention
- Treat this as normal during job cancellation — always restore the interrupt flag
- Avoid cancelling during snapshot startup on huge tables when possible
- Monitor job-manager logs to distinguish expected vs unexpected interruption
When it happens
Trigger: The task thread running sample-based split construction gets interrupted — job cancelled by user, pipeline stopped, or engine shutting down while sampling a large table.
Common situations: Cancelling a long-running incremental-snapshot job on a big DB2 table; engine failover/stop during the sampling phase; CLI Ctrl-C during job startup.
Related errors
- Interrupted while emitting initial DROP TABLE events
- Thread interrupted
- Error to discover tables:
- Table is not enabled for capture
- Error to check tables:
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/6ee0c70b06e1d269.
Report an issue: GitHub.