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
- Ignore if seen during normal pipeline cancellation/worker shutdown; the interrupt flag is restored and resources are still released.
- Avoid cancelling the pipeline while Flight reads are mid-teardown; drain the source before stopping workers.
- Check the Arrow Flight server for slow/hanging connections that make client.close() block long enough to be interrupted.
- 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
- Don't interrupt worker threads during graceful pipeline teardown.
- Use runner-supported drain/cancel APIs instead of raw thread interruption.
- Keep the Arrow Flight server responsive so close() finishes quickly.
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
- Caught exception whilw trying to close append client. Ignori
- Interrupted while waiting for space in buffer
- expansion service error: %s
- executor service was interrupted
- Received message missing publishTime
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/5b193444264c6377.
Report an issue: GitHub.