pinpoint-apm/pinpoint · warning · InterruptedIOException

ScanTask Interrupted

Error message

ScanTask Interrupted

What it means

ScanTask.next blocks on its internal resultQueue; if the waiting thread is interrupted it restores the interrupt flag, marks the task done, and throws InterruptedIOException('ScanTask Interrupted'). This propagates shutdown/cancellation to the parallel-scanner consumer instead of silently dropping rows.

Solutions

  1. Ensure the application doesn't interrupt scan threads prematurely (check shutdown hooks and Future.cancel(true) usage)
  2. Increase scan/operation timeouts so slow scans complete without being cancelled
  3. Retry the scan after an interruption if it was spurious, on a non-interrupted executor
  4. Catch InterruptedIOException in the consumer and treat it as a cancelled scan, re-checking Thread.currentThread().isInterrupted()

Example fix

// before
try { while ((r = scanTask.next()) != null) {} } catch (InterruptedIOException e) { /* ignored */ }
// after
try { while ((r = scanTask.next()) != null) {} }
catch (InterruptedIOException e) {
    logger.warn("Scan cancelled, retrying", e);
    retryScan();
}
Defensive patterns

Strategy: try-catch

Try / catch

try {
    while ((result = scanTask.next()) != null) { consume(result); }
} catch (InterruptedIOException e) {
    Thread.currentThread().interrupt(); // preserve cancel signal
    throw new ScanCancelledException(e);
}

Prevention

When it happens

Trigger: Thread interruption while blocked on resultQueue.take() — typically executor shutdown, application shutdown, or a timeout path that interrupts the scanning thread during a parallel HBase scan iteration.

Common situations: Graceful shutdown of pinpoint web/collector mid-scan; Future.cancel(true) on scan tasks; container/deploys killing threads; timeouts interrupting long-running distributed scans.

Understand the failure class

Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/ae8d84b173ae2cc6. Report an issue: GitHub.

Appendix: source

Thrown at commons-hbase/src/main/java/com/navercorp/pinpoint/common/hbase/parallel/ScanTask.java:134

            return new DistributedScanner(saltKeySize, scanners);
        }
    }

    @Override
    public Result next() throws IOException {
        if (this.isQueueClosed) {
            return null;
        }
        if (localBuffer != null) {
            return localBuffer;
        }
        Result take = null;
        try {
            take = this.resultQueue.take();
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            isDone = true;
            throw new InterruptedIOException("ScanTask Interrupted");
        }
        if (take == END_RESULT) {
            this.isQueueClosed = true;
            localBuffer = null;
            return null;
        }
        localBuffer = take;
        return localBuffer;
    }

    @Override
    public void consume() {
        localBuffer = null;
    }

    @Override
    public boolean isExhausted() {
        return this.isQueueClosed;

View on GitHub (pinned to 744c3d3075)