lidavidm commented on a change in pull request #10318:
URL: https://github.com/apache/arrow/pull/10318#discussion_r644146344



##########
File path: python/pyarrow/tests/test_flight.py
##########
@@ -1810,3 +1813,62 @@ def test_generic_options():
                                 generic_options=options)
         with pytest.raises(pa.ArrowInvalid):
             client.do_get(flight.Ticket(b'ints'))
+
+
+class CancelFlightServer(FlightServerBase):
+    """A server for testing StopToken."""
+
+    def do_get(self, context, ticket):
+        schema = pa.schema([])
+        rb = pa.RecordBatch.from_arrays([], schema=schema)
+        return flight.GeneratorStream(schema, itertools.repeat(rb))
+
+    def do_exchange(self, context, descriptor, reader, writer):
+        schema = pa.schema([])
+        rb = pa.RecordBatch.from_arrays([], schema=schema)
+        writer.begin(schema)
+        while not context.is_cancelled():
+            # TODO: writing schema.empty_table() here hangs/fails
+            writer.write_batch(rb)

Review comment:
       It should raise an exception, but either way, the client is gone at this 
point so there's not much the server can do.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to