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

Endless Restart Loop #61

Open
unknown8063 opened this issue Dec 24, 2014 · 0 comments
Open

Endless Restart Loop #61

unknown8063 opened this issue Dec 24, 2014 · 0 comments

Comments

@unknown8063
Copy link

This is possibly related to #57.

When PHP Daemon tears itself down for an automatic reboot it invokes its own destruct method explicitly. The destruct method loops through worker and plugin aliases, invoking each of their teardown methods and removing the objects

        foreach(array_merge($this->workers, $this->plugins) as $object) {
            $this->{$object}->teardown();
            unset($this->{$object});
        }

However, the aliases are maintained in the arrays. I'm noticing that occasionally the PHP interpreter is invoking the destruct method again. In the second iteration, the workers and plugins are already unset so it attempts to call a method on an undefined property. The error that is raised causes PHP Daemon to attempt to restart itself.... Which calls the destruct method again and the whole party continues.

Because the original restart was actually successful in spawning a new instance of the daemon, you end up with one correctly functioning daemon and a few endless looping walking dead daemons.

I'm using version 2.1.1. Also, thanks for the library and the great documentation! Overall, this has been working great for me.

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