fabric8io/fabric8 — pull request #1455 by hekonsek (2014-05-20 21:09:38+00:00)
Title: Fixed race condition in ProcessUtils#killProcess method

Hi,

`ProcessUtils#killProcess` execution often ends up in `IllegalThreadStateException: process hasn't exited` exception being thrown. This happens because kill command is usually slower than Java here and then `process.exitValue()` is called before the kill command finishes execution.

We should call blocking `process.waitFor()` method here instead so kill process can finish and join our Java thread.

We could consider executing kill command via executor framework and use futures here, but I'm not sure if it is worth such optimization, as kill command is pretty fast.

Cheers.