A child process that stops due to an error would only trigger a onProcessStopped event after the calling thread has requested a the subsystem to stop. There is currently no notifications that the process has stopped until then. It is called when requested by the caller thread, but not on error or self-termination.
I hesitate to call that a bug, but it is certainly not an optimal arrangement.
At the same time, to achieve a symmetrical SMO lifecycle, the onProcessStarted() and onProcessStopped() should be in the process thread, whereas onStarted() should be moved to the calling thread.
SMO Process Life Cycle.pdf
A child process that stops due to an error would only trigger a onProcessStopped event after the calling thread has requested a the subsystem to stop. There is currently no notifications that the process has stopped until then. It is called when requested by the caller thread, but not on error or self-termination.
I hesitate to call that a bug, but it is certainly not an optimal arrangement. At the same time, to achieve a symmetrical SMO lifecycle, the onProcessStarted() and onProcessStopped() should be in the process thread, whereas onStarted() should be moved to the calling thread.