strongloop/strong-pm — pull request #54 by rmg (2014-10-30 01:02:56+00:00)
Title: Don't crash on runner exit after soft-stop

When issuing a soft-stop (either directly or via soft-restart) the
runner registered an event handler for 'exit' with the callback that
is given. Because that callback eventually bubbles up to a beforeCreate
hook on a ServerAction model instance, a phantom response is sent at
any point in the future when the runner emits an 'exit' event. This
manifests as Express throwing an exception because the callback
ultimately attempts to send a response, complete with new response
headers, on a response that has already been sent.

This went unnoticed because the tests did not trigger any restarts
after the soft-restart test and because there is no soft-stop test.