|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2011-04-20 07:36 UTC] craig dot lumley at everythingeverywhere dot com
  [2011-04-21 01:44 UTC] hradtke@php.net
  [2011-04-21 06:13 UTC] craig dot lumley at everythingeverywhere dot com
  [2011-05-15 05:41 UTC] hradtke@php.net
  [2011-08-20 07:41 UTC] hradtke@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 14:00:01 2025 UTC | 
Description: ------------ The gearman worker code return GEARMAN_SUCCESS if an uncaught exception is thrown in worker callback function. Reproduce code: --------------- <?php $gmworker= new GearmanWorker(); $gmworker->addServer(); $gmworker->addFunction("func", "func"); while($gmworker->work()); function func($job) { throw new Exception('oww!'); } ?> Patch: svn diff php_gearman.c Index: php_gearman.c =================================================================== --- php_gearman.c (revision 310107) +++ php_gearman.c (working copy) @@ -3438,8 +3438,13 @@ worker_cb->zcall->value.str.val : "[undefined]"); *ret_ptr= GEARMAN_WORK_FAIL; } - *ret_ptr= jobj->ret; + if (EG(exception)) { + *ret_ptr= GEARMAN_WORK_FAIL; + } else { + *ret_ptr= jobj->ret; + } + if (zret_ptr == NULL || Z_TYPE_P(zret_ptr) == IS_NULL) { result= NULL; } else { Expected result: ---------------- The GearmanClient::returnCode() method should return GEARMAN_WORK_FAIL. Actual result: -------------- The GearmanClient::returnCode() method returns GEARMAN_SUCCESS.