You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "no23reason (via GitHub)" <gi...@apache.org> on 2023/03/03 13:38:32 UTC

[GitHub] [arrow] no23reason opened a new issue, #34431: [Python] Expose gRPC cancel to FlightStreamWriter

no23reason opened a new issue, #34431:
URL: https://github.com/apache/arrow/issues/34431

   ### Describe the enhancement requested
   
   ### Use case
   
   In certain situations, client code using the FlightClient to perform the DoPut operation might need to cancel half way through writing (for example because its underlying data source threw an exception).
   
   The explicit cancellation is useful when the server wants to avoid saving partially written flights when client cancels.
   
   Currently, there is no explicit way to do so in Python (at least the docs do not mention any and I was not able to find one in source code either).
   
   ### Suggested solution
   
   The `FlightStreamWriter` has a new `cancel(self)` method that cancels the underlying stream so that the server receives the information that the client has cancelled.
   
   ### Related implementation/Prior art
   
   The use case is already possible In Java client. There is the `error(Throwable ex)` method of `OutboundStreamListener` that the client code can call and it will end the stream so that the server knows the operation was cancelled - `server_call_context.is_cancelled()` returns `True`.
   
   Also, the complementary Python `FlightStreamReader` already has a `cancel(self)` method with similar semantics.
   
   ### Component(s)
   
   FlightRPC, Python


-- 
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: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Python] Expose gRPC cancel to FlightStreamWriter [arrow]

Posted by "nph (via GitHub)" <gi...@apache.org>.
nph commented on issue #34431:
URL: https://github.com/apache/arrow/issues/34431#issuecomment-1791928118

   I'd like to second this enhancement request - extending the _cancel_ functionality from the server side to the client side would be very useful. Currently we need to work around the lack of a cancel method in `FlightStreamWriter` by explicitly calling a "cleanup" flight Action on the client side to ensure that partially uploaded datasets are removed from the flight server in the event of an interruption / exception during a DoPut.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] no23reason commented on issue #34431: [Python] Expose gRPC cancel to FlightStreamWriter

Posted by "no23reason (via GitHub)" <gi...@apache.org>.
no23reason commented on issue #34431:
URL: https://github.com/apache/arrow/issues/34431#issuecomment-1453656562

   I am not sure I follow, the `FlightMetadataReader` that we have on the client side (returned by `client.do_put()` along the `FlightStreamWriter`) does not seem to be cancelable either. Only the server has the cancellable `FlightStreamReader`. Or am I missing something?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] lidavidm commented on issue #34431: [Python] Expose gRPC cancel to FlightStreamWriter

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #34431:
URL: https://github.com/apache/arrow/issues/34431#issuecomment-1453679075

   Ah, sorry, I got mixed up. 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] lidavidm commented on issue #34431: [Python] Expose gRPC cancel to FlightStreamWriter

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #34431:
URL: https://github.com/apache/arrow/issues/34431#issuecomment-1453622080

   The cancel on the reader affects both sides of the operation (confusing, yes)


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org