Persistent Queue does not update fast enough
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Gearman |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
In my test environment, I am running 0.27 via supervisord:
command=gearmand -vvvvvvvv -q libsqlite3 --user=www --libsqlite3-
For simplicity, I'm running a single worker, also managed by supervisord.
The jobs are getting inserted into the database properly from what I can see. However, the worker is running the same task multiple times, which can be anywhere between 2 and 10 times before the job is finally removed from the persistent queue.
The worker code is pretty simple:
<?php
$worker = new GearmanWorker();
$worker-
$worker-
while ($worker->work()) {
if ($worker-
echo "return_code: " . $worker-
break;
}
}
function adjustCredits(
{
$job-
$workload = unserialize(
$player = new Account();
$player-
$player-
$token = new Token();
$token-
$credit_
$amount = new TokenAmount();
$amount-
$amount-
if(
$response = $player-
}
else {
$response = $player-
}
switch(
case VIN_SOAP_
return GEARMAN_SUCCESS;
default:
}
}
?>
The client code is also simple:
<?php
$gearman = new GearmanClient();
$gearman-
$job = array(
'player' => $adjustment-
'amount' => $adjustment-
);
$job_params = serialize($job);
$job_id = sha1(json_
$rc = $gearman-
?>
I can confirm that only one job gets inserted into the sqlite persistent queue.
Changed in gearmand: | |
importance: | Undecided → Wishlist |
status: | New → Confirmed |
I ran gearmand through strace while this issue was happening. I don't know if this will help debug what's happening or not.
http:// pastebin. com/h85gL42L