-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
FFI Execution Plans that spawn threads panic #13851
Comments
Seems like there are two problems:
Maybe we need to have some way to pass in a handle to the tokio runtime 🤔 |
There is only one point where we have ffi calls that are async, currently. This happens in the record batch stream. So I think what needs to happen is that within the private data for the RBS we also include an We do pass a context. I worry about a possible problem where we could have deadlocks if we have two different runtimes each doing a blocking call. The only place that is immediately jumping out to me as a potential problem spot is I think the immediate next thing to do is to build up a good reproducible test, ideally that I could include as a unit test. |
Initial testing of passing in an |
Hi @timsaucer thanks for creating this issue! This is the current WIP PR https://github.com/kevinjqliu/iceberg-rust/pull/2/files I've been looking at reasons why I'm see the error message: Would love to get your thoughts on this and see if its the same issue |
I tried to incorporate #13937 in kevinjqliu/iceberg-rust#3 and ran into a different error https://gist.github.com/kevinjqliu/cba636cfd4a2a0c8acbba060768e33c9
I'm not sure where the error occurs, but i think integrating the iceberg table provider will be a good test for this issue. This is my first time working with rust/pyo3/datafusion so there might be something obvious I'm not seeing. |
I can definitely help and I have a PR to fix the spawn issue. I will be back to work on this next week if you can give me a few dats |
Thank you! Feel free to ping me if you need any help setting up the env for iceberg-rust. |
Describe the bug
If you have an FFI Execution Plan that spawns it's own tasks, it has no reactor and causes a panic.
To Reproduce
This is most easily demonstrated in datafusion-python. Just create a table provider that spawns a thread. I have examples on my computer but they are non-trivial (and it's probably me working on this issue).
Expected behavior
We should never cause a panic across the ffi boundary.
Additional context
No response
The text was updated successfully, but these errors were encountered: