xborder commented on code in PR #1090:
URL: https://github.com/apache/arrow-java/pull/1090#discussion_r4526896347
##########
flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcFlightStreamResultSet.java:
##########
@@ -192,23 +198,40 @@ public boolean next() throws SQLException {
return true;
}
- if (currentEndpointData != null) {
- currentEndpointData.getStream().getRoot().clear();
- if (currentEndpointData.getStream().next()) {
- populateDataForCurrentFlightStream();
- continue;
+ try {
+ if (currentEndpointData != null) {
+ currentEndpointData.getStream().getRoot().clear();
+ if (currentEndpointData.getStream().next()) {
+ populateDataForCurrentFlightStream();
+ continue;
+ }
+
+ enqueueEndpointData(currentEndpointData);
}
- flightEndpointDataQueue.enqueue(currentEndpointData);
+ currentEndpointData = getNextEndpointStream(false);
+ } catch (final FlightRuntimeException e) {
+ // A concurrent statement.cancel() (or close) cancels in-flight
FlightStreams,
+ // which surface here as CANCELLED. Normalize to Avatica's "Statement
canceled".
+ if (flightEndpointDataQueue.isClosed()
Review Comment:
Done. Added the cancellation flag and a regression test for cancelling a
blocked next().
--
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]