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

Fixes #48 #50

Open
wants to merge 20 commits into
base: 2.1.1a
Choose a base branch
from
Open

Fixes #48 #50

wants to merge 20 commits into from

Conversation

brunnels
Copy link
Contributor

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

shaneharter and others added 20 commits November 13, 2012 11:41
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
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
@brunnels
Copy link
Contributor Author

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);
    }
  }

@brunnels
Copy link
Contributor Author

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.

@brunnels
Copy link
Contributor Author

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.

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

Successfully merging this pull request may close these issues.

2 participants