mesos/spark — pull request #443 by stephenh (2013-02-03 00:53:46+00:00)
Title: Close the redirectStream threads so waitFor doesn't block.

I can finally run "sbt test" and have it not block. I've done 10 runs in a row and not seen anything block.

Without this change, ~every other "sbt test" run was hanging on process.waitFor, which kept the test thread's LocalSparkCluster worker system from shutting down.

From poking at it with jstack, the child executor JVM (that destroy was supposed to have killed) was continuing blithely on as if nothing happened.

Googling around, it seems like Process is generally black magic, and prone to hangs like this. One result mentioned ensuring all the streams were closed first, and that seems to be working.