php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60307 add_task(GEARMAN_INVALID_ARGUMENT) unique name longer then GEARMAN_UNIQUE_MAX_S
Submitted: 2011-11-15 15:46 UTC Modified: 2012-08-06 04:50 UTC
From: hradtke@php.net Assigned: hradtke (profile)
Status: Closed Package: gearman (PECL)
PHP Version: 5.3.8 OS: CentOS 5.7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: hradtke@php.net
New email:
PHP Version: OS:

 

 [2011-11-15 15:46 UTC] hradtke@php.net
Description:
------------
Ok, updated everything to .25 and re-built all packages.

The new feature of GEARMAN_UNIQUE_MAX_SIZE is causing problems.

GearmanClient::doBackground(): add_task(GEARMAN_INVALID_ARGUMENT)
unique name longer then GEARMAN_UNIQUE_MAX_SIZE -> libgearman/add.cc:
131 in /blah/blah.php

We use the same ID for the message and the uniqueId and have never had
any problems in the past.

Usage:

$client->doBackground('jobs_publish', 42789639, 42789639);

At first I thought maybe its just interpreting the uniqueId as an int
so I explicitly cast it as a string first and still failed.

$client->doBackground('rtu_careers_jobs_publish', 42789639,
(string)42789639);

Let me know if I can provide any additional information.

CentOS 5.7
PHP 5.3.6
PECL Gearman 0.8
Gearmand 0.25

Ok, we figured out a work-around already.

Passing in a pure integer as uniqueId does not work. Even when casting
as a string.

However, we simply changed the uniqueId to something like this:

$uniqueId =
substr(str_shuffle(str_repeat('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
5)),0,5);
$client->doBackground('jobs_publish', 42789639, $uniqueId);


And everything works!!!


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-15 15:47 UTC] hradtke@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: hradtke
 [2012-02-02 06:54 UTC] hradtke@php.net
-Status: Assigned +Status: Feedback
 [2012-02-02 06:54 UTC] hradtke@php.net
I am unable to reproduce this bug using pecl/gearman 0.8, libgearman
0.25 with the provided test case. The pecl/gearman code explicitly
casts the integer to a string and works fine. I even stepped through
the libgearman code to verify everything was working in order. Are you
still seeing this bug?
 [2012-08-06 04:50 UTC] hradtke@php.net
-Status: Feedback +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC