bepec opened a new issue, #38668: URL: https://github.com/apache/arrow/issues/38668
### Describe the usage question you have. Please include as many useful details as possible. The Flight RPC API clearly suggests the possibility of cancelling incomplete flight stream by the client. There are few methods that seemingly should help to detect if the call was cancelled on server's side: - CallContext::isCancelled() - ServerStreamListener::isCancelled() - ServerStreamListener::setOnCancelHandler() I was trying to use all of these in FlightProducer::getStream() method implementation, but none of them did work. Polling functions always return false, and the cancel handler is only called upon leaving the getStream(). I made a test similar to [TestLeak.java](https://github.com/apache/arrow/blob/go/v14.0.0/java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestLeak.java) - with the difference that I send data and call listener.completed() in getStream() body and not in cancel handler. Again, in this case the handler is only called after getStream() is completed - which doesn't make sense as getStream is called only once per ticket request. We have a record batch producer implementation which can generate tons of data for single ticket, for hours. It seems very reasonable to stop producing batches and release resources if client can't accept data anymore. Is there any practical way we could do this with available Flight RPC implementation in Java? ### Component(s) FlightRPC, Java -- 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]
