You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "danepitkin (via GitHub)" <gi...@apache.org> on 2023/04/14 20:06:11 UTC

[GitHub] [arrow] danepitkin commented on pull request #34948: GH-34897: [Python] Don't attempt to aquire the GIL when Python is finalizing

danepitkin commented on PR #34948:
URL: https://github.com/apache/arrow/pull/34948#issuecomment-1509176564

   Hmm interesting. From the Python C API docs[1] when acquiring the GIL:
   ```
   Note Calling this function from a thread when the runtime is finalizing will terminate the thread, even if the thread was not created by Python. You can use _Py_IsFinalizing() or [sys.is_finalizing()](https://docs.python.org/3/library/sys.html#sys.is_finalizing) to check if the interpreter is in process of being finalized before calling this function to avoid unwanted termination.
   ```
   
   I wonder if we should be checking for Py_IsFinalizing everywhere we acquire the GIL? 
   
   [1] https://docs.python.org/3/c-api/init.html#c.PyGILState_Ensure


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