Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python] Fix threading bugs under the free-threaded version related to borrowed references and Pandas initialization #44046

Closed
Tracked by #43536
lysnikolaou opened this issue Sep 10, 2024 · 1 comment

Comments

@lysnikolaou
Copy link
Contributor

Describe the bug, including details regarding any error messages, version, and platform.

Sub-issue of #43536.

There's two threading related bugs under the free-threaded build:

Component(s)

Python

lysnikolaou added a commit to lysnikolaou/arrow that referenced this issue Sep 10, 2024
pitrou pushed a commit to lysnikolaou/arrow that referenced this issue Sep 12, 2024
pitrou added a commit that referenced this issue Sep 12, 2024
…#44047)

### Rationale for this change

Fix threading bugs that could leads to races under the free-threaded build.

### What changes are included in this PR?

- Use `PySequence_ITEM` instead of the `Fast` variant on lists under the free-threaded build.
- Use `std::once_flag` to make sure that `pandas` staic data only gets initialized once.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.

* GitHub Issue: #44046

Lead-authored-by: Lysandros Nikolaou <[email protected]>
Co-authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
@pitrou pitrou added this to the 18.0.0 milestone Sep 12, 2024
@pitrou
Copy link
Member

pitrou commented Sep 12, 2024

Issue resolved by pull request 44047
#44047

@pitrou pitrou closed this as completed Sep 12, 2024
khwilson pushed a commit to khwilson/arrow that referenced this issue Sep 14, 2024
…pandas (apache#44047)

### Rationale for this change

Fix threading bugs that could leads to races under the free-threaded build.

### What changes are included in this PR?

- Use `PySequence_ITEM` instead of the `Fast` variant on lists under the free-threaded build.
- Use `std::once_flag` to make sure that `pandas` staic data only gets initialized once.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.

* GitHub Issue: apache#44046

Lead-authored-by: Lysandros Nikolaou <[email protected]>
Co-authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants