Skip to content

Make All pyclass Rust Types Sendable  #347

@kdbrooks

Description

@kdbrooks

Describe the bug
Python users expect to be able to use Python Objects on any interpreter thread and the Python interpreter freely moves objects between threads:

PyO3 Must Be Send

PyO3 recommends making pyclass types Sendable by using Arc in Place of Rc etc.

Right now, users will see a panic in Python if objects are used between threads:

thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `ThreadId(15)`,
 right: `ThreadId(13)`: datafusion_python::context::PySessionContext is unsendable, but sent to another thread!', /Users/[redacted]/.cargo/registry/src/artifactory.8451.com-3c2d1e7414f45d14/pyo3-0.18.3/src/impl_/pyclass.rs:881:9

To Reproduce
Use a SessionContext in different Python threads.

Expected behavior
Python users expect to use DataFusion objects in any thread.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions