{"record":{"id":"ab4280bf0913b0bd","repo":"alibaba/DataX","slug":"unable-to-flush-interrupted-while-doing-another-a","errorCode":null,"errorMessage":"Unable to flush, interrupted while doing another attempt","messagePattern":"Unable to flush, interrupted while doing another attempt","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"doriswriter/src/main/java/com/alibaba/datax/plugin/writer/doriswriter/DorisWriterManager.java","lineNumber":181,"sourceCode":"                visitor.streamLoad(flushData);\n                LOG.info(String.format(\"Async stream load finished: label[%s].\", flushData.getLabel()));\n                startScheduler();\n                break;\n            } catch (Exception e) {\n                LOG.warn(\"Failed to flush batch data to Doris, retry times = {}\", i, e);\n                if (i >= options.getMaxRetries()) {\n                    throw new IOException(e);\n                }\n                if (e instanceof DorisWriterExcetion && (( DorisWriterExcetion )e).needReCreateLabel()) {\n                    String newLabel = createBatchLabel();\n                    LOG.warn(String.format(\"Batch label changed from [%s] to [%s]\", flushData.getLabel(), newLabel));\n                    flushData.setLabel(newLabel);\n                }\n                try {\n                    Thread.sleep(1000l * Math.min(i + 1, 10));\n                } catch (InterruptedException ex) {\n                    Thread.currentThread().interrupt();\n                    throw new IOException(\"Unable to flush, interrupted while doing another attempt\", e);\n                }\n            }\n        }\n    }\n\n    private void checkFlushException() {\n        if (flushException != null) {\n            throw new RuntimeException(\"Writing records to Doris failed.\", flushException);\n        }\n    }\n}\n","sourceCodeStart":163,"sourceCodeEnd":193,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/doriswriter/src/main/java/com/alibaba/datax/plugin/writer/doriswriter/DorisWriterManager.java#L163-L193","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Treat as cancellation: check DataX job logs for the *original* failure that triggered the kill — this message is a victim, not the cause","Re-run the failed split with a fresh labelPrefix once the root cause is fixed","Raise scheduler/job timeouts so transient Doris retries (backoff up to 10s per round) can complete","Reduce maxRetries if you prefer fast-fail over letting the worker sit in backoff"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (IOException e) {\n    if (Thread.currentThread().isInterrupted() || e.getCause() == null && e.getMessage().contains(\"interrupted while doing another attempt\")) {\n        // job was cancelled during retry backoff; safe to abort this split and re-run later with new labelPrefix\n        Thread.currentThread().interrupt();\n    }\n    throw e;\n}","preventionTips":["Size scheduler timeouts above total retry backoff time (maxRetries * up-to-10s) so retries can finish","Investigate the original load error — this interruption only fires because a first attempt already failed"],"tags":["doris","datax","interruption","retry"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}