alibaba/DataX · error · IOException

Unable to flush, interrupted while doing another attempt

Error message

Unable to flush, interrupted while doing another attempt

What it means

Inside the retry loop of the flush worker: after a failed stream-load attempt, the thread sleeps 1s*min(i+1,10) before the next attempt. If that sleep is interrupted, the interrupt flag is restored and an IOException wrapping the original failure 'e' is thrown — the retry loop aborts without exhausting maxRetries.

Source

Thrown at doriswriter/src/main/java/com/alibaba/datax/plugin/writer/doriswriter/DorisWriterManager.java:181

                visitor.streamLoad(flushData);
                LOG.info(String.format("Async stream load finished: label[%s].", flushData.getLabel()));
                startScheduler();
                break;
            } catch (Exception e) {
                LOG.warn("Failed to flush batch data to Doris, retry times = {}", i, e);
                if (i >= options.getMaxRetries()) {
                    throw new IOException(e);
                }
                if (e instanceof DorisWriterExcetion && (( DorisWriterExcetion )e).needReCreateLabel()) {
                    String newLabel = createBatchLabel();
                    LOG.warn(String.format("Batch label changed from [%s] to [%s]", flushData.getLabel(), newLabel));
                    flushData.setLabel(newLabel);
                }
                try {
                    Thread.sleep(1000l * Math.min(i + 1, 10));
                } catch (InterruptedException ex) {
                    Thread.currentThread().interrupt();
                    throw new IOException("Unable to flush, interrupted while doing another attempt", e);
                }
            }
        }
    }

    private void checkFlushException() {
        if (flushException != null) {
            throw new RuntimeException("Writing records to Doris failed.", flushException);
        }
    }
}

View on GitHub (pinned to 80ec23d5c5)

Solutions

  1. Treat as cancellation: check DataX job logs for the *original* failure that triggered the kill — this message is a victim, not the cause
  2. Re-run the failed split with a fresh labelPrefix once the root cause is fixed
  3. Raise scheduler/job timeouts so transient Doris retries (backoff up to 10s per round) can complete
  4. Reduce maxRetries if you prefer fast-fail over letting the worker sit in backoff
Defensive patterns

Strategy: try-catch

Try / catch

catch (IOException e) {
    if (Thread.currentThread().isInterrupted() || e.getCause() == null && e.getMessage().contains("interrupted while doing another attempt")) {
        // job was cancelled during retry backoff; safe to abort this split and re-run later with new labelPrefix
        Thread.currentThread().interrupt();
    }
    throw e;
}

Prevention

When it happens

Trigger: DataX task cancellation (user kill, scheduler timeout, framework shutdown hook) sends interrupt() to the flush thread while it sleeps between Doris load attempts. The original load error 'e' is preserved as the cause.

Common situations: Job killed because a previous task failed (DataX cancels siblings); job timeout configured in the scheduler; JVM shutdown during backoff; long retry backoff colliding with an aggressive cancellation policy.

Related errors


AI-assisted analysis of alibaba/DataX@80ec23d5c5 (2026-08-14). Data as JSON: /api/errors/ab4280bf0913b0bd. Report an issue: GitHub.