Skip to content

Commit

Permalink
GH-40004: [Python][FlightRPC] Release GIL in GeneratorStream (#40005)
Browse files Browse the repository at this point in the history
Fixes #40004.

* Closes: #40004

Authored-by: lupko <[email protected]>
Signed-off-by: David Li <[email protected]>
  • Loading branch information
lupko authored and raulcd committed Feb 20, 2024
1 parent 23a8991 commit 4b11536
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/pyarrow/_flight.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2013,8 +2013,9 @@ cdef CStatus _data_stream_next(void* self, CFlightPayload* payload) except *:
max_attempts = 128
for _ in range(max_attempts):
if stream.current_stream != nullptr:
check_flight_status(
stream.current_stream.get().Next().Value(payload))
with nogil:
check_flight_status(
stream.current_stream.get().Next().Value(payload))
# If the stream ended, see if there's another stream from the
# generator
if payload.ipc_message.metadata != nullptr:
Expand Down

0 comments on commit 4b11536

Please sign in to comment.