apache/beam · error

Error closing BufferAllocator

Error message

Error closing BufferAllocator

What it means

WARN logged in ArrowFlightIO reader's close(): closing the Arrow BufferAllocator raised an exception. Like the FlightStream/FlightClient cleanup above it, the error is caught and logged rather than propagated, so a failing allocator release (often a symptom of an outstanding buffer/memory leak elsewhere) does not prevent the remaining teardown steps.

Solutions

  1. Investigate Arrow memory leaks (unclosed Arrow records/batches) which commonly cause allocator close failures
  2. Verify allocator children are closed before the root allocator
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at sdks/java/io/arrow-flight/src/main/java/org/apache/beam/sdk/io/arrowflight/ArrowFlightIO.java:504 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/0722b79e3d0e3fcf. Report an issue: GitHub.

Appendix: source

Thrown at sdks/java/io/arrow-flight/src/main/java/org/apache/beam/sdk/io/arrowflight/ArrowFlightIO.java:504

          stream.close();
        }
      } catch (Exception e) {
        LOG.warn("Error closing FlightStream", e);
      }
      try {
        if (client != null) {
          client.close();
        }
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        LOG.warn("Interrupted closing FlightClient", e);
      }
      try {
        if (allocator != null) {
          allocator.close();
        }
      } catch (Exception e) {
        LOG.warn("Error closing BufferAllocator", e);
      }
    }

    @Override
    public BoundedSource<Row> getCurrentSource() {
      return currentSource;
    }
  }

  // ======================== WRITE ========================

  // TODO: Return a write result with failed rows for dead-letter handling instead of PDone.
  @AutoValue
  public abstract static class Write extends PTransform<PCollection<Row>, PDone> {

    abstract @Nullable String host();

    abstract int port();

View on GitHub (pinned to 12126d8942)