Hello everyone!

I've been having some issues lately with Maya and QThread that I hope 
someone can help me, because I surely don't have any idea why that would be.

The crash I'm having is another variant of what Viktor Petrov asked here 
<https://stackoverflow.com/questions/56629553/proper-pyside-qthread-use-in-maya-to-avoid-hard-crash>,
 
a sudden crash with no dialog or warning, just Maya closing unexpectedly. 
Inside of Maya I'm using a QThread that queries some data through HTTP 
requests (in my case specifically, this is done by the Ftrack 
<http://ftrack.com>API) and emits the result as a string through a signal. 
This tool works on Nuke as well and so far our Nuke users have not reported 
any issues of this kind.

The crashes seem random but constant. There are no traceback or errors. 
I've gotten a process dump on the moment of the crash but to be honest 
either I don't know how to interpret it or it really doesn't help.

I've also tried to switch to QRunnable + QThreadPool but doesn't solve the 
issue either. All data is interchanged as a string and I'm using a 
queue.Queue instance which should be thread safe. There is a small delay 
between the thread starting and the crash which leads me to think that the 
reason is either the result signal or the HTTP request itself.

Is there any special precautions to use when dealing with QThread + HTTP 
requests in Maya?

This is a slightly modified version of the code I'm using:

https://gist.github.com/salvaom/c6df5b39d3a94667c19da20c4d223888#file-qthread1-py

This is the code called from the main process, requestData is called to 
start a job and onThreadJobFinished is the callback when the thread 
finishes. The events have a unique ID to make sure no python object is sent 
to the thread, but that didn't solve the issue either.

https://gist.github.com/salvaom/c6df5b39d3a94667c19da20c4d223888#file-qthread2-py


I'm using Maya 2019, PySide2 - 2.0.0~alpha0, Qt - 5.6.1.

Thanks,
Salvador.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/14ed2c93-fea5-4293-a45d-14041aa5e1af%40googlegroups.com.

Reply via email to