commons-exec
commons-exec copied to clipboard
[EXEC-121] Wait for async execution until process has started
This also has the side effect of ensuring that the process destroyer, if any, is registered.
Have marked this as draft for now because I am not sure if this a good solution. It causes the following behavior differences (which might be acceptable though):
- Longer delay for async execution because calling thread now has to wait until process is started
- Fail-fast behavior might be unexpected for caller; might expect that failure is reported through
ExecuteStreamHandler
Maybe the race condition reported in EXEC-121 could also be solved differently by having another shutdown hook which verifies that all processes are started and their process destroyers (if any) have been registered. Though this logic might be quite complicated.