Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

ON_SHUTDOWN hook not called during automatic restart #55

Open
theintz opened this issue Sep 11, 2014 · 1 comment
Open

ON_SHUTDOWN hook not called during automatic restart #55

theintz opened this issue Sep 11, 2014 · 1 comment

Comments

@theintz
Copy link

theintz commented Sep 11, 2014

In my application I have registered a handler for the ON_SHUTDOWN hook, which cleans up some network connections. During regular shutdown, the hook is executed fine, but when the daemon is automatically restarted, the hook is not called, resulting in lingering connections.

The reason for this is that the hook is dispatched from the destructor of the Daemon class, which in the case of an automatic restart is called when the exit call is made in the restart() method. Unfortunately, for non-intuitive reasons, right before the exit call is made, the array containing all the callbacks is cleared, so once the destructor runs, there aren't any hooks leftover to call.

@theintz
Copy link
Author

theintz commented Sep 11, 2014

I see that this has been fixed in the more recent versions (2.1+). Could you please create a new tag for the stable versions, so packagist can pull them in? That makes it much easier to upgrade them. Thanks a lot!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant