State:Closed|icon_bug|icon_katana|database:public|Resolution:Fixed|TargetRelease:3.0v1|BugID:266401|
import subprocessp = subprocess.Popen(['/path/to/katana', '--script', 'something.py'], stdout=subprocess.PIPE)for line in iter(p.stdout.readline, ''): print linep.wait() Steps to reproduce
1) Create a subprocess using the example below:
import subprocessp = subprocess.Popen(['/path/to/katana', '--script', 'something.py'], stdout=subprocess.PIPE)for line in iter(p.stdout.readline, ''): print linep.wait() 2) Launch Katana with the sub process, see if the script quits.
Result: Long hanging which causes deadlock
Workaround
Launch Katana as a separate subprocess and wait() for it to complete. This allows Attribute Script Interpreters to detect that katanaBin has exited. It costs an extra process hanging around.
This doesn't work as a 100% solution.
Reproduced by support
Katana2.5v1 - CentOS6.9
Katana2.5v7 - CentOS6.9
Katana2.6v1 - CentOS6.9
Katana2.6v3 - CentOS6.9
Expected behaviour
The script should run and then exit correctly. It should not need to wait for Katana to close before exiting.
Actual behaviour
The script waits, causing hanging and potential deadlock.
We're sorry to hear that
Please tell us why