ID 462525 - Katana Queue (KQ) is not shut down properly when katanaBin crashes or is terminated

Follow

Problem summary
The Katana Queue daemon process (KQD.py) is not shut down when katanaBin crashes or is terminated.

A KQD process tree might look like the following:

$ ps -C python -C pythonWrapper.sh -o pid,cmd=Command --forest --width 1000   PID Command10817 /bin/bash /opt/Katana4.0v1/bin/python2.7/bin/pythonWrapper.sh /opt/Katana4.0v1/plugins/Resources/Core/Plugins/kq/KQD.pyc --num-agents=210823  \_ /opt/Katana4.0v1/bin/python2.7/bin/python /opt/Katana4.0v1/plugins/Resources/Core/Plugins/kq/KQD.pyc --num-agents=210827      \_ /opt/Katana4.0v1/bin/python2.7/bin/python /opt/Katana4.0v1/plugins/Resources/Core/Plugins/kq/Agent/Agent.pyc test.env --request-port=46574 --update-port=39658 --broadcast-port=34126 --heartbeat-interval=100010828      \_ /opt/Katana4.0v1/bin/python2.7/bin/python /opt/Katana4.0v1/plugins/Resources/Core/Plugins/kq/Agent/Agent.pyc test.env --request-port=46574 --update-port=39658 --broadcast-port=34126 --heartbeat-interval=1000

Customer reported version
4.0__4.0v1

Customer reported platform
centos7

Steps to reproduce

1) Start Katana

2) Kill katanaBin

killall -9 katanaBin

Expected behavior
KQ is shutdown.

Actual behavior
KQ is still running (KQD.pyc)

ps -C python -C pythonWrapper.sh -o pid,cmd=Command --forest --width 1000 

Workaround
Kill all python process with:

killall python  # This is probably a bad idea, unless you are sure Katana's Python interpreter is the only Python interpreter running in the system

Reproduced by support
This bug has been reproduced in:
Katana 4.0v1 - CentOS 7, Windows 10

Earliest version tested
Katana 4.0v1 - KQ feature did not exist before this version
 

    We're sorry to hear that

    Please tell us why