BryanCutler commented on code in PR #38110:
URL: https://github.com/apache/arrow/pull/38110#discussion_r1355784469
##########
java/flight/flight-core/src/main/java/org/apache/arrow/flight/FlightClient.java:
##########
@@ -412,6 +412,16 @@ public ClientStreamListener getWriter() {
return writer;
}
+ /**
+ * Make sure stream is drained. You must call this to be notified of any
errors that may have
+ * happened after the exchange is complete. This should be called after
`getWriter().completed()`
+ * and instead of `getWriter().getResult()`.
+ */
+ public void getResult() {
+ // After exchange is complete, make sure stream is drained to propagate
errors through reader
+ reader.next();
+ }
+
/** Shut down the streams in this call. */
@Override
public void close() throws Exception {
Review Comment:
It is drained already in the call to `reader.close()`. From what I can tell,
it will suppress any exception though. So probably better off draining with the
call to `getResult()` before closing to handle any errors, wdyt?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]