I ran into an issue about Maya 2016 extension 2 hanging earlier this week. The customer has a custom locator node in their scene and Maya hangs when running code like below:
import maya.cmds as cmds
cmds.evaluationManager(mode="parallel")
for i in range(10):
cmds.currentTime(i)
After spending some time for debugging, the issue was found. It turns out that when Maya is executing Python, it will acquire a Python lock for the interpreter. During the parallel evaluation of your scene caused by cmds.currentTime, another working thread is created and tries to acquire the same lock, resulting in a deadlock scenerio. In Maya 2017, it only happens when MAYA_RETAIN_PYTHON_GIL is set in your system environment. MAYA_RETAIN_PYTHON_GIL is for the users who are experiencing performance issues when executing high volumes of python commands. Maya will be more prone to deadlocks if custom Python nodes are evaluating in other threads.
To avoid the deadlock, please use Mel command only if you are going to evaluate the scene. You could also try to rewrite your nodes in C++ to avoid sharing a lock with the Python interpreter.

Leave a Reply to Chengxi LiCancel reply