-
Notifications
You must be signed in to change notification settings - Fork 134
Fixes #48 #50
base: 2.1.1a
Are you sure you want to change the base?
Fixes #48 #50
Conversation
Conflicts: README.md
Added running_count method to Mediator
Added fix for fatal error during worker cleanup that fixes issue #41
Fix Memcache lib Refactore Lock plugins code to be more eficient
Repush to 2.1.1 with compatibility and bug fixes
merge with upstream
Work in progress on listening to ON_REAP in mediator
or confusion about which php module is being utilized
Fixed issue with Mediator reap() forking during daemon shutdown Added restart env to make it easier to restart via signal Changed daemon to always recover_workers on restart Cleaned up some residual comments and added some comments for IDE code completion to IWorker
The only issue I've run into so far with this is in the worker timeout callback I now need to check if the worker property still exists before trying to call retry() or it throws a fatal error and kills the daemon. This either needs to be worked around or documented. Another solution is change the daemon functionality a little and add protected worker setter and getter to Core_Daemon and make the worker property private. Then do the property_exists check in the getter. Here's my current timeout method public function recordUpdateWorkerTimeout($call, $log)
{
$this->logDebug("Job {$call->id} to {$call->method}() timed out");
if($call->retries < 3)
{
if(property_exists($this, 'recordUpdateWorker'))
$this->recordUpdateWorker->retry($call);
}
else
{
$this->logDebug("Retries Concluded. I Give Up");
$this->set('restart', true);
}
} |
I'm experiencing an issue after the daemon has been running for a while where it gets stuck and just restarts itself over and over. Trying to track down where the problem lies now so will need some additional fixes before merging this pull request. |
Tracked down the issue to be happening when workers auto_restart and tear down their msg_queues and semaphores while other workers are still using them. There's already a check in the mediator destruct for if recover_workers is used but it needs to be changed to only destroy the queue if it's the last worker. |
Fixed issues with workers shm and queue cleanup
Fixed issue with Mediator reap() forking during daemon shutdown
Added restart env to make it easier to restart via signal
Changed daemon to always recover_workers on restart
Cleaned up some residual comments and added some comments for IDE code
completion to IWorker