apache/iceberg · error · RuntimeException

Interrupted while waiting for array pool entry

Error message

Interrupted while waiting for array pool entry

What it means

ArrayPoolDataIteratorBatcher's getCachedEntry waits on a pool entry (thread-interruptible); if the thread is interrupted while blocked in pool.pollEntry(), it re-interrupts the thread and throws RuntimeException. This happens when the record reader's batch fetch task is cancelled or interrupted.

Source

Thrown at flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/source/reader/ArrayPoolDataIteratorBatcher.java:157

    }

    @Override
    public void wakeUp() {
      pool.wakeUp();
    }

    /**
     * Gets a cached entry from the pool, blocking until an entry is recycled or the reader is woken
     * up.
     *
     * @return a cached array from the pool, or {@code null} if woken up
     */
    private T[] getCachedEntry() {
      try {
        return pool.pollEntry();
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        throw new RuntimeException("Interrupted while waiting for array pool entry", e);
      }
    }
  }
}

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Usually benign during job cancel/failover — verify the cancellation was intentional and restart/resume the job.
  2. If it happens unexpectedly, check for external code calling Thread.interrupt() on task threads (custom thread pools, watchdogs).
  3. Check upstream fetch tasks for stuck behavior that delays pool entry return and triggers slow cancellation.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  T[] batch = batcher.batch(records);
} catch (RuntimeException e) {
  if (Thread.currentThread().isInterrupted() || e.getMessage().contains("Interrupted")) {
    // expected during cancel/failover — exit quietly
    return;
  }
  throw e;
}

Prevention

When it happens

Trigger: The thread batching fetched records into arrays is interrupted while waiting for a pooled array — typically during job cancellation, failover, or task shutdown.

Common situations: Job cancellation while reading; Flink task failover mid-read; shutdown of the source reader.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/9822a8be4f9fe732. Report an issue: GitHub.