Skip to content

AthenaPython: Disable TPyClassGenerator to fix deadlock.

Scott Snyder requested to merge ssnyder/athena:lock.AthenaPython-20210814 into master

Remove the TPyClassGenerator from the list of class generators. TPyClassGenerator makes classes defined in Python accessible to ROOT. We don't rely on this at all in Athena. Further, in MT jobs, we can get deadlocks. TClass::GetClass holds the ROOT internal mutexes, and if it ends up calling TPyClassGenerator, then the generator will end up acquiring the Python GIL. On the other hand, Python-based algorithms will hold the GIL. If they then use PyROOT (or do anything which could trigger I/O), then they can try to acquire the ROOT internal locks. Since we have the same locks being acquired in different orders in different threads, we can deadlock.

Ideally, TClass::GetClass should probably drop the ROOT locks before calling a class generator. But since we don't actually use this functionality on Athena, just suppress it.

Merge request reports