apache/iceberg · warning · RuntimeException

Interrupted while waiting for array pool entry

Error message

Interrupted while waiting for array pool entry

What it means

ArrayPoolDataIteratorBatcher.getCachedEntry polls an object/array pool that blocks until an entry is available; if the waiting thread is interrupted, it re-establishes the interrupt flag and wraps the InterruptedException in a RuntimeException. This normally happens only when the source task is being cancelled or is shutting down.

Source

Thrown at flink/v2.1/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 expected during cancellation — verify the job was intentionally cancelled/restarted; if not, look at what interrupted the reader thread.
  2. Check for downstream backpressure causing records/batches to never be returned to the pool; inspect backpressure metrics.
  3. Tune batch/array pool sizing or the reader's fetch batch size so entries are recycled faster.
  4. If the job repeatedly dies with this during failover, ensure cancellation is given time to finish and the source honors the interrupt cleanly.

Example fix

// before: huge batches starve the pool
IcebergSource.builder().fetchBatchSize(100_000)...
// after
IcebergSource.builder().fetchBatchSize(1_024)... // smaller batches recycle pool entries
Defensive patterns

Strategy: retry

Validate before calling

// check backpressure/pool health before assuming a bug
if (taskMetrics.getBackPressuredTimeMs().getValue() > threshold) {
  // reduce fetch batch size or scale parallelism
}

Prevention

When it happens

Trigger: The record reader thread calls batch() -> getCachedEntry() and pool.pollEntry() is interrupted while blocked waiting for a pooled array (task cancellation, checkpoint/stop-with-savepoint, job failover).

Common situations: Job cancellation racing with record reading; reader thread starvation where the pool never recycles arrays because downstream stalled; misconfigured pool sizing under high parallelism.

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 apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/4d2365686ed1b96b. Report an issue: GitHub.