Edit report at https://bugs.php.net/bug.php?id=60307&edit=1

 ID:                 60307
 Updated by:         hrad...@php.net
 Reported by:        hrad...@php.net
 Summary:            add_task(GEARMAN_INVALID_ARGUMENT) unique name
                     longer then GEARMAN_UNIQUE_MAX_S
-Status:             Open
+Status:             Assigned
 Type:               Bug
 Package:            gearman
 Operating System:   CentOS 5.7
 PHP Version:        5.3.8
-Assigned To:        
+Assigned To:        hradtke
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2011-11-15 15:46:58] hrad...@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!!!



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=60307&edit=1

Reply via email to