From 5137a74e90da7595c0137fb3bc6d5c9633e18295 Mon Sep 17 00:00:00 2001 From: David James Date: Wed, 29 Sep 2010 15:50:08 -0700 Subject: [PATCH] Exit explicitly at end of parallel_emerge, so child processes exit as well. So, we've been seeing parallel_emerge hang after printing "Done". It's hard to know for sure why this hang is happening, but my theory right now is that the Python garbage collector doesn't always know that it needs to kill the child processes when we exit normally at the bottom of the script. Adding sys.exit(0) tells Python that yes, we really want to exit. I haven't tested my hypothesis above, because the hang we've been seeing is pretty rare and is hard to reproduce. So I'm planning on testing by just putting in this workaround and seeing if it fixes the problem. TEST=Run ./parallel_emerge world BUG=chromium-os:5976 Change-Id: I7b4f2ec4ccba9b00f22f3739dfd3eff51ceed425 Review URL: http://codereview.chromium.org/3448030 --- parallel_emerge | 1 + 1 file changed, 1 insertion(+) diff --git a/parallel_emerge b/parallel_emerge index 61e9920efb..9a77ef45c4 100755 --- a/parallel_emerge +++ b/parallel_emerge @@ -1733,6 +1733,7 @@ def main(): os.execvp(os.path.realpath(sys.argv[0]), args) print "Done" + sys.exit(0) if __name__ == "__main__": main()