apache/seatunnel · info · InterruptedException

Enumerator thread is interrupted.

Error message

Enumerator thread is interrupted.

What it means

AbstractSplitEnumerator.checkThrowInterruptedException() polls the thread's interrupt flag and, if set, throws InterruptedException with this message. It lets the streaming enumerator exit promptly when SeaTunnel is cancelling the job instead of continuing to plan splits.

Source

Thrown at seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/source/enumerator/AbstractSplitEnumerator.java:189

    @SneakyThrows
    @Override
    public void close() throws IOException {
        log.info("Close split enumerator.");
        if (icebergCatalog instanceof AutoCloseable) {
            ((AutoCloseable) icebergCatalog).close();
        }
    }

    protected Table loadTable(TablePath tablePath) {
        return icebergCatalog.loadTable(
                TableIdentifier.of(tablePath.getDatabaseName(), tablePath.getTableName()));
    }

    protected void checkThrowInterruptedException() throws InterruptedException {
        if (Thread.currentThread().isInterrupted()) {
            log.info("Enumerator thread is interrupted.");
            throw new InterruptedException("Enumerator thread is interrupted.");
        }
    }

    private static int getSplitOwner(String splitId, int numReaders) {
        return HashUtils.bucketIndex(splitId.hashCode(), numReaders);
    }

    protected void addPendingSplits(Collection<IcebergFileScanTaskSplit> newSplits) {
        int numReaders = context.currentParallelism();
        for (IcebergFileScanTaskSplit newSplit : newSplits) {
            int ownerReader = getSplitOwner(newSplit.splitId(), numReaders);
            pendingSplits.computeIfAbsent(ownerReader, r -> new ArrayList<>()).add(newSplit);
            log.info("Assigning {} to {} reader.", newSplit, ownerReader);
        }
    }

    protected void assignPendingSplits(Set<Integer> pendingReaders) {
        for (int pendingReader : pendingReaders) {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. No fix needed — this is a normal, expected shutdown path; let the InterruptedException propagate
  2. If it appears while the job should still be running, investigate what interrupted the thread (engine shutdown, master node restart)
  3. Avoid swallowing InterruptedException in custom code around the enumerator, which delays clean shutdown
Defensive patterns

Strategy: try-catch

Try / catch

try { enumerator.run(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); /* clean exit, expected on cancel */ }

Prevention

When it happens

Trigger: Job cancellation or terminal failure while the enumerator thread runs; the interrupt flag is set (usually by the engine's job cancellation) and the enumerator next calls this check (e.g. before planning the next batch of splits).

Common situations: User cancels a streaming iceberg job via CLI/UI; job fails and the engine interrupts coordinator threads; slow split planning keeps the enumerator alive until the next check point.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/ddb8aea2396c8bf5. Report an issue: GitHub.