Uh oh!
There was an error while loading. Please reload this page.
GH-43536: [Python] Do not use borrowed references APIs - #43540
Conversation
General question: are the (or if the answer is that those APIs are not supported for older versions of CPython, adopting |
lysnikolaou
commented
Aug 5, 2024
We could use the strong reference APIs in the non-free-threaded build as well. Adopting |
pitrou
commented
Aug 6, 2024
These changes add a lot of conditional code. Also, sometimes they are not necessary, if we are sure the container (list/dict) will not be mutated in another thread. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
lysnikolaou
commented
Aug 6, 2024
Thanks @pitrou for the review! I updated the PR to add |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
lysnikolaou
commented
Aug 13, 2024
This is ready for another review. |
pitrou
left a comment
There was a problem hiding this comment.
LGTM, thanks a lot @lysnikolaou . I will rebase and try to run more CI.
174a1ef to
202de1aComparepitrou
commented
Aug 15, 2024
@github-actions crossbow submit -g python -g wheel |
Revision: 202de1a Submitted crossbow builds: ursacomputing/crossbow @ actions-ceaf2f2afb |
pitrou
commented
Aug 15, 2024
CI failures look unrelated, I'll merge. |
After merging your PR, Conbench analyzed the 7 benchmarking runs that have been run so far on merge-commit 894f72f. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 6 possible false positives for unstable benchmarks that are known to sometimes produce them. |
### Rationale for this change #43540 already vendored `pythoncapi_compat.h`, so closing #43069 by using this as well for `Py_IsFinalizing` (which was added in #42034, and for which we opened that follow-up issue to use `pythoncapi_compat.h` instead) Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
### Rationale for this change apache/arrow#43540 already vendored `pythoncapi_compat.h`, so closing apache/arrow#43069 by using this as well for `Py_IsFinalizing` (which was added in apache/arrow#42034, and for which we opened that follow-up issue to use `pythoncapi_compat.h` instead) Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Rationale for this change
For better reference safety under Python free-threaded builds (i.e. with the GIL removed), we should be using
Py(List|Dict)_GetItemRefthat return strong references and are implemented in a thread-safe manner.What changes are included in this PR?
Are these changes tested?
I ran the tests with the free-threaded build before and after, and there's the same expected failures.