|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-07-06 00:04 UTC] alex at 1stleg dot com
Description:
------------
Hi,
I am compiling pecl-gearman 1.1.2 against gearmand 1.1.16 and I am running into a very strange issue. Everything appears to be compiling and working except for a couple of functions on GearmanWorker class.
PHP Warning: GearmanWorker::addServers(): (null) in ...
PHP Warning: GearmanWorker::addFunction(): Unable to add function to Gearman Worker: (null) GEARMAN_INVALID_ARGUMENT in ...
This appears to be a problem when talking from the PHP extension to libgearman. The php extension is definitely getting called with the correct values ("127.0.0.1" and 4730) @ https://github.com/hjr3/pecl-gearman/blob/gearman-1.0/php_gearman.c#L3311 but obj->ret == GEARMAN_INVALID_ARGUMENT when I debug. The only way that should happen is that &(obj->worker) == NULL on libgearman's end, but &(obj->worker) definitely looks like a pointer from the PHP extension end. I am not sure whats happening...
I have also tested the same gearmand libgearman version against 2.x (hjr3/pecl-gearman) and I am having the same problem.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 13:00:01 2025 UTC |
Ok, under normal circumstances this works fine. It seems to soil the pants only if the GearmanWorker class is a member variable of a class that extends Stackable! I.E. ` ``` class MyWorker extends Stackable { /** @var GearmanWorker $gearman */ protected $gearman; public function __construct() { $this->gearman = new GearmanWorker(); // Poops pants here. $this->gearman->addServer("127.0.0.1", 4730); } ... } ```