PyROOT with Apache and django

TPyROOTApplication::CreatePyROOTApplication will print messages all the way down to the return statement. So it seems a problem upon return?

Yes, at this point it is clear that the issue is in libPyROOT.

This is of course with those two lines in cppyy.py commented out. I’m well past my level of understanding of what is going on here and would either need some more guidance on how to resolve this or need to pass it along to to someone who is more of an expert.

I’ve also gone ahead and checked that gInterpreter.EnableAutoLoading() continues without hanging and was able to generate messages all the way to the closing bracket of the function (TCling::EnableAutoLoading). But still the python cppyy.py hangs after the call.

My suspicion is on Utility::PyErr_Occurred_WithGIL() in PyROOT::TMethodHolder::Execute(). Replace it with PyErr_Occurred().

1 Like

Apache no longer hangs. This fixes the issue. I have no idea how to report this as a JIRA bug to get it fixed. An explanation as to what is going on here might be educational as well.

@wlav Thank you very much for your help on this matter, I doubt it would have been resolved without your tenacity.

Not sure it’s a bug.

For example, it could be that PyROOT is compiled with thread support, while the appache module is done without. Or that the apache module does not call PyEval_InitThreads() after Py_Initialize().

(The only bug would be that the PyROOT code, both in TMethodHolder and in TPython is not protected with #ifdef WITH_THREAD.)

I.e. that would be a config problem.

1 Like

Maybe @amadio understands well enough to file a JIRA ticket?

Might as well add the reason for this code, then.

At issue is that the C++ code that PyROOT calls can itself call Python code, which in turn can call C++ code through PyROOT etc., etc. If something fails, how do you get it up through all the layers, especially since any of the intermediate C++ calls could have released the GIL? This code attempts to cover that problem: processing both the result of the current layer and potentially an error set by a deeper layer.

I attempted to report this as a bug:
https://sft.its.cern.ch/jira/projects/ROOT/issues/ROOT-9287

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.