Skip to content

[Python][RDF] Pure Python callables in Define/Filter deadlock with EnableImplicitMT #24140

Open

Description

@siliataider

Check duplicate issues.

  • Checked for duplicates

Description

A pure-Python callable passed to RDataFrame.Define (or Filter) deadlocks when ROOT.EnableImplicitMT() is on and the event loop has more than one task. The process hangs forever.

The main thread triggers the event loop from Python and keeps the GIL while it waits in TThreadExecutor::ParallelFor. The TBB worker threads block in PyGILState_Ensure when they call the Python callback.

Reproducer

import ROOT

ROOT.EnableImplicitMT(4)

def square(x: float) -> float:
    return x * x

df = ROOT.RDataFrame(10).Define("x", "double(rdfentry_)").Define("y", square, ["x"])
print(df.Sum("y").GetValue())  # never returns

ROOT version

6.42

Installation method

from source

Operating system

linux, fedora

Additional context

No response

Activity

  1. self-assigned this
    on Nov 13, 2026
  2. SamdaniSayam commented on Nov 13, 2026

    @SamdaniSayam

    Proposed fix in #24148. AI disclosure: the fix was drafted with LLM assistance, reviewed and understood by me; I take full responsibility for it. CI will be the first full verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions