From 7740c76aa1ec34d7c0728cd5635635e31393bc44 Mon Sep 17 00:00:00 2001 From: Bryan Cutler Date: Wed, 11 Oct 2023 14:15:03 -0700 Subject: [PATCH] Use loop to drain exchange reader --- .../src/main/java/org/apache/arrow/flight/FlightClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/flight/flight-core/src/main/java/org/apache/arrow/flight/FlightClient.java b/java/flight/flight-core/src/main/java/org/apache/arrow/flight/FlightClient.java index 55f448a0d03ff..91e3b4d052f39 100644 --- a/java/flight/flight-core/src/main/java/org/apache/arrow/flight/FlightClient.java +++ b/java/flight/flight-core/src/main/java/org/apache/arrow/flight/FlightClient.java @@ -436,7 +436,7 @@ public ClientStreamListener getWriter() { */ public void getResult() { // After exchange is complete, make sure stream is drained to propagate errors through reader - reader.next(); + while (reader.next()) { }; } /** Shut down the streams in this call. */