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

_PyOS_SigintEvent() is needed for interruptible waiting on main thread #128684

Open
jbms opened this issue Jan 9, 2025 · 0 comments
Open

_PyOS_SigintEvent() is needed for interruptible waiting on main thread #128684

jbms opened this issue Jan 9, 2025 · 0 comments
Labels
topic-C-API type-bug An unexpected behavior, bug, or error

Comments

@jbms
Copy link
Contributor

jbms commented Jan 9, 2025

Bug report

Bug description:

Moved from #108605 (comment)

In #108605, _PyOS_SigintEvent was removed from the public headers.

TensorStore relies on that function here: https://github.com/google/tensorstore/blob/eda046b10158e7d82fdb0f23aeecdfdeb8ac5aa3/python/tensorstore/future.cc#L105 to enable synchronously blocking on the readiness of a custom Future type while allowing Ctrl+C to interrupt when running on the main thread.

The current workaround is to manually declare the function since the symbol is still available.

I'm not aware of a usable alternative. Since signal.set_wakeup_fd only allows a single fd to be set globally, it isn't usable from a library. The best alternative would probably be to poll by waking up every few hundred milliseconds.

CPython versions tested on:

3.13

Operating systems tested on:

No response

@jbms jbms added the type-bug An unexpected behavior, bug, or error label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-C-API type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants