You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ra...@apache.org on 2024/02/20 11:21:38 UTC

(arrow) 26/30: GH-40004: [Python][FlightRPC] Release GIL in GeneratorStream (#40005)

This is an automated email from the ASF dual-hosted git repository.

raulcd pushed a commit to branch maint-15.0.x
in repository https://gitbox.apache.org/repos/asf/arrow.git

commit 4b1153620a973ad95484ec008419cf806e35b589
Author: Lubo Slivka <lu...@gooddata.com>
AuthorDate: Thu Feb 8 22:58:07 2024 +0100

    GH-40004: [Python][FlightRPC] Release GIL in GeneratorStream (#40005)
    
    Fixes #40004.
    
    * Closes: #40004
    
    Authored-by: lupko <lu...@gooddata.com>
    Signed-off-by: David Li <li...@gmail.com>
---
 python/pyarrow/_flight.pyx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/python/pyarrow/_flight.pyx b/python/pyarrow/_flight.pyx
index a2ff045f25..67ee759056 100644
--- a/python/pyarrow/_flight.pyx
+++ b/python/pyarrow/_flight.pyx
@@ -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: