@nik684 said in Deadlock: TakeData.SetCurrentTake() from Python holds the GIL:
Also worth to note:
We hit the same freeze in BaseDocument.AddUndo() and maxon.GraphTransaction.Commit() on the main thread while a Python tag was drawing.
py-spy showed the same pattern: the main thread holds the GIL and waits, and the draw/ca thread sits in PyGILState_Ensure.
Could those wrappers be missing the GIL release too?
Undo maybe be related to Take switch though.
AddUndo just as some other Undo methods does not release the GIL, I just checked. But other than for the take system, this could be intentional here, due to adding an undo could imply changes to PyObject instances (which are not allowed while you drop the GIL).
For maxon.GraphTransaction.Commit() I would have to check, things work entirely different there, the Maxon API is not implemented in a traditional way, things work much differently there. I would need code and a context for the latter. For the former I probably need a good night sleep to think about it and a reason where this would be relevant.
Cheers,
Ferdinand