mhconradt opened a new issue, #15069:
URL: https://github.com/apache/arrow/issues/15069
### Describe the bug, including details regarding any error messages,
version, and platform.
In short, when using PyArrow Flight server and client, messages are received
by the program using the client after the `do_action` function has returned,
rather than as available.
This seems like a bug because the RPC defines the return type of `DoAction`
as `stream Result`.
I have not tried reproducing this using C++.
I'm using PyArrow 10.0.1, Python 3.10.8, MacOS Monterey 12.2.1.
This example program:
```
import time
from datetime import datetime
from pyarrow.flight import Action
from pyarrow.flight import FlightClient
from pyarrow.flight import FlightServerBase
class ActionServer(FlightServerBase):
def do_action(self, context, action):
for i in range(5):
now = datetime.utcnow().isoformat()
print('Server time', now)
yield now.encode()
time.sleep(1)
else:
print('Exited at', datetime.utcnow().isoformat())
def test_results_immediately_available():
with ActionServer() as server, FlightClient(('localhost', server.port))
as client:
action = Action(b'', b'foo')
for result in client.do_action(action):
print('Message', result.body.to_pybytes().decode('utf-8'),
'received at', datetime.utcnow().isoformat())
if __name__ == '__main__':
test_results_immediately_available()
```
outputs the following:
```
Server time 2022-12-22T18:06:23.424057
Server time 2022-12-22T18:06:24.429895
Server time 2022-12-22T18:06:25.434969
Server time 2022-12-22T18:06:26.437020
Server time 2022-12-22T18:06:27.442276
Exited at 2022-12-22T18:06:28.443606
Message 2022-12-22T18:06:23.424057 received at 2022-12-22T18:06:28.444388
Message 2022-12-22T18:06:24.429895 received at 2022-12-22T18:06:28.444424
Message 2022-12-22T18:06:25.434969 received at 2022-12-22T18:06:28.444437
Message 2022-12-22T18:06:26.437020 received at 2022-12-22T18:06:28.444449
Message 2022-12-22T18:06:27.442276 received at 2022-12-22T18:06:28.444460
```
Ideally each message would be received by the client before the next one is
sent.
### 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]