@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Treat PHP7 "Throwable" exceptions like other unhandled "Exception" cases in the worker queue

Summary: See PHI1745. Under PHP7, errors raised as Throwable miss this "generic exception" logic and don't increment their failure count. Instead, treat any "Throwable" we don't recognize like any "Exception" we don't recognize.

Test Plan:
- Under PHP7, caused a worker task to raise a Throwable (e.g., call to undefined method, see D21270).
- Ran `bin/worker execute --id ...`.
- Before: worker failed, but did not increment failure count.
- After: worker fails and increments failure count as it would for other types of unknown error.

Differential Revision: https://secure.phabricator.com/D21271

+8 -1
+7
src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php
··· 134 134 135 135 $did_succeed = false; 136 136 $worker = null; 137 + $caught = null; 137 138 try { 138 139 $worker = $this->getWorkerInstance(); 139 140 $worker->setCurrentWorkerTask($this); ··· 180 181 181 182 $result = $this; 182 183 } catch (Exception $ex) { 184 + $caught = $ex; 185 + } catch (Throwable $ex) { 186 + $caught = $ex; 187 + } 188 + 189 + if ($caught) { 183 190 $this->setExecutionException($ex); 184 191 $this->setFailureCount($this->getFailureCount() + 1); 185 192 $this->setFailureTime(time());
+1 -1
src/infrastructure/daemon/workers/storage/PhabricatorWorkerTask.php
··· 34 34 ) + parent::getConfiguration(); 35 35 } 36 36 37 - final public function setExecutionException(Exception $execution_exception) { 37 + final public function setExecutionException($execution_exception) { 38 38 $this->executionException = $execution_exception; 39 39 return $this; 40 40 }