Pipeline hangs at subprocess.Popen() when shut it down. I looked into source code of subprocess lib. py27 doesn't do any lock while py3 locks when waiting. Py3 added locks at other places of Popen() as well, all unlocked places with py2 may contribute to the problem. We can add a lock when calling Popen() to prevent the deadlock.