lidavidm commented on code in PR #38110:
URL: https://github.com/apache/arrow/pull/38110#discussion_r1355001623
##########
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();
Review Comment:
Possibly loop while reader.next()?
##########
java/flight/flight-core/src/main/java/org/apache/arrow/flight/FlightStream.java:
##########
@@ -207,6 +207,8 @@ public void close() throws Exception {
} else {
AutoCloseables.close(closeables);
}
+ // Remove any metadata after closing to prevent negative refcnt
+ applicationMetadata = null;
Review Comment:
Should this go in the finally instead? I suppose if this throws the
application is unlikely to close again.
##########
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:
Should we drain the stream in close as well?
--
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]