php: client.c:773: gearman_client_run_tasks: Assertion `client->task != ((void *)0)`failed.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Gearman |
Fix Released
|
High
|
Eric Day |
Bug Description
I'm using libgearman 0.11 with PECL PHP extension gearman 0.6.0 on CentOS 5.4 using Apache 2.2 and PHP 5.3.
While running a Gearman Worker I got this error:
php: client.c:773: gearman_
Context; I made this PHP script:
http://
When I start one worker, everything goes smooth. When I start an additional second worker, no problem. When I start the third worker, the first worker crashes with the error above. At the moment the third worker starts, it registers to the first worker (addNeighbour). This 'addNeighbour' will call the 'updateNeighbour' function on the first Worker itself. In the loop, the IF-statement will return false for the first time, so the else-part is executed. When it comes to #110 the crash occurs.
Little strange to me is that after the first worker crashed, I can start as many additional workers as I like... they won't crash.
This bug keeps me from using Gearman in PHP at the moment. Thanks in advance!
Related branches
- Gearman-developers: Pending requested
-
Diff: 126 lines (+70/-1)2 files modifiedlibgearman/client.c (+11/-1)
tests/client_test.c (+59/-0)
Changed in gearmand: | |
assignee: | nobody → Eric Day (eday) |
milestone: | none → 0.13 |
status: | Confirmed → Fix Committed |
Changed in gearmand: | |
status: | Fix Committed → Fix Released |
The problem is due to the following condition:
client_do - job X
timeout, don't process result
client_do - job Y
get result for job handle X
since client_do reuses data structures (only 1 active job at a time), context for job X is lost
cannot find job X, hit assert()
I think the best fix here is to remove the assert and simply ignore the result packets if it is no longer found in the active client task list.