Subject: | Possible bug in cataching exceptions |
I'm not sure if this is really a bug, but it can result in some odd (and
potentially very bad) behaviour, so I'll leave it up to you to decide.
In the start() method, the call to the component's start method is
wrapped in an eval. If that component itself forks and its children
throw an exception, it will be caught by that eval block. This will call
the stopped() method, deleting the PID file. However the component's
parent process could still be running.
If start() is called again, the PID file won't exist, so a new instance
of the component will be started up, meaning two are running (this is
the very bad part). The workaround is to make sure a component catches
all exceptions thrown by its children, however it seems like
Proc::Launcher should handle this for us.
Perhaps you could call is_running() after trapping an exception in that
eval block, before calling stopped()?