apache/beam · warning

Interrupted closing FlightClient

Error message

Interrupted closing FlightClient

What it means

This is a warning logged in ArrowFlightIO's UnboundedArrowSource close() when Thread.interrupt() arrives while the FlightClient.close() call (which blocks on gRPC teardown) is in progress. The library catches InterruptedException, restores the interrupt flag with Thread.currentThread().interrupt(), and continues closing the allocator. It is not thrown at the caller; it signals that the client close did not finish gracefully.

Source

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

      return current;
    }

    @Override
    public void close() throws IOException {
      try {
        if (stream != null) {
          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 ========================

View on GitHub (pinned to 12126d8942)

Solutions

  1. Ignore if seen during normal pipeline cancellation/worker shutdown; the interrupt flag is restored and resources are still released.
  2. Avoid cancelling the pipeline while Flight reads are mid-teardown; drain the source before stopping workers.
  3. Check the Arrow Flight server for slow/hanging connections that make client.close() block long enough to be interrupted.
  4. Upgrade beam-sdks-java-io-arrow-flight and arrow versions to pick up teardown robustness fixes.

Example fix

// before: client.close() blocks indefinitely and can be interrupted
client.close();
// after: bound the blocking window so interruption is unlikely
client.withCloseTimeout(java.time.Duration.ofSeconds(30)).close();
Defensive patterns

Strategy: try-catch

Try / catch

// interruption is already handled internally; at call sites, restore interrupt status
try {
  client.close();
} catch (InterruptedException e) {
  Thread.currentThread().interrupt();
}

Prevention

When it happens

Trigger: Pipeline teardown of an Arrow Flight Read UnboundedSource while Thread.interrupt() is delivered to the closing thread, e.g. worker shutdown, bundle cancellation, or pipeline cancellation racing with close().

Common situations: Runner-initiated cancellation of a streaming pipeline; autoscaling draining workers; a test harness or executor shutting down while FlightClient.close() blocks on network teardown; container kill with graceful-stop signaling.

Related errors


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