{"record":{"id":"211d9fbb2b0e16d0","repo":"apache/iceberg","slug":"interrupted-while-waiting-for-array-pool-entry-211d9f","errorCode":null,"errorMessage":"Interrupted while waiting for array pool entry","messagePattern":"Interrupted while waiting for array pool entry","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"warning","filePath":"flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/source/reader/ArrayPoolDataIteratorBatcher.java","lineNumber":157,"sourceCode":"    }\n\n    @Override\n    public void wakeUp() {\n      pool.wakeUp();\n    }\n\n    /**\n     * Gets a cached entry from the pool, blocking until an entry is recycled or the reader is woken\n     * up.\n     *\n     * @return a cached array from the pool, or {@code null} if woken up\n     */\n    private T[] getCachedEntry() {\n      try {\n        return pool.pollEntry();\n      } catch (InterruptedException e) {\n        Thread.currentThread().interrupt();\n        throw new RuntimeException(\"Interrupted while waiting for array pool entry\", e);\n      }\n    }\n  }\n}\n","sourceCodeStart":139,"sourceCodeEnd":162,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/source/reader/ArrayPoolDataIteratorBatcher.java#L139-L162","documentation":"ArrayPoolDataIteratorBatcher.getCachedEntry borrows an array from a blocking pool via pool.pollEntry(). If the waiting thread is interrupted, it re-interrupts the thread and wraps the InterruptedException in a RuntimeException so it propagates through the batching pipeline.","triggerScenarios":"The task thread calling batch() is interrupted while blocked waiting for a free array from the pool — typically during Flink task cancellation or job failover shutdown.","commonSituations":"Cancelling a Flink job mid-read; task manager failover; shutting down the cluster while a source reader is batching records.","solutions":["Usually benign during job cancellation — no action needed; the task is stopping anyway","If unexpected, check for manual Thread.interrupt() calls in custom code or overly aggressive timeouts","Retry the job/checkpoint; verify pool sizing (Flink reader batch size config) if stalls trigger cancellation","Inspect thread dumps for deadlock around the pool if interruptions happen without cancellation"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  RecordsByArrays<T> batch = batcher.batch(records);\n} catch (RuntimeException e) {\n  if (e.getCause() instanceof InterruptedException && Thread.currentThread().isInterrupted()) {\n    // task is being cancelled: exit reader loop cleanly\n    return;\n  }\n  throw e;\n}","preventionTips":["Don't interrupt reader threads manually; rely on Flink cancellation","If batching stalls cause timeouts, tune reader batch size / pool capacity properties","During job cancel/restart, treat this as expected shutdown noise"],"tags":["flink","interruption","cancellation","concurrency"],"backgroundTag":"request-timeout","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}