fabric8io/fabric8 — pull request #1313 by hekonsek (2014-05-07 20:32:16+00:00)
Title: Fixed ProcessController threads deadlock.

Hi,

While playing with new Java Container I experienced `container-create-child` fabric command hanging from time to time.

I've debugged it a little bit and found out that `DefaultProcessController#getExecutor()` method returns `newSingleThreadExecutor`. While the same instance of the executor is used to execute the process (`bin/launcher start` in my case) and to asynchronously handle the output of that process (in `OutputProcessor#start()`), it may leads to the deadlock because single thread of executor is supposed to monitor process output and executing the process itself. Finishing execution of the failing process requires to collect the output of that process (in order to display it) - that is the root cause of the deadlock.

I changed the `DefaultProcessController#getExecutor()` default `newSingleThreadExecutor` to `Executors.newFixedThreadPool(2, ... )`, because two threads is the minimal size of the pool we need to avoid process execution and output processing deadlocks.

Cheers.