1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-04-09 02:48:41 +02:00

Increase the visibility of permanent task failures in task queue

Make permanent failures always reach the log.
Make `bin/worker execute` report exceptions properly.
This commit is contained in:
epriestley 2015-03-15 13:27:05 -07:00
parent 8a6acf88e0
commit 6b86f81fe4
2 changed files with 5 additions and 7 deletions

View file

@ -21,17 +21,15 @@ final class PhabricatorTaskmasterDaemon extends PhabricatorDaemon {
$ex = $task->getExecutionException(); $ex = $task->getExecutionException();
if ($ex) { if ($ex) {
if ($ex instanceof PhabricatorWorkerPermanentFailureException) { if ($ex instanceof PhabricatorWorkerPermanentFailureException) {
$this->log( throw new PhutilProxyException(
pht( pht('Permanent failure while executing Task ID %d.', $id),
'Task %s failed permanently: %s', $ex);
$id,
$ex->getMessage()));
} else if ($ex instanceof PhabricatorWorkerYieldException) { } else if ($ex instanceof PhabricatorWorkerYieldException) {
$this->log(pht('Task %s yielded.', $id)); $this->log(pht('Task %s yielded.', $id));
} else { } else {
$this->log("Task {$id} failed!"); $this->log("Task {$id} failed!");
throw new PhutilProxyException( throw new PhutilProxyException(
"Error while executing task ID {$id} from queue.", pht('Error while executing Task ID %d.', $id),
$ex); $ex);
} }
} else { } else {

View file

@ -47,7 +47,7 @@ final class PhabricatorWorkerManagementExecuteWorkflow
$console->writeOut("Executing task {$id} ({$class})..."); $console->writeOut("Executing task {$id} ({$class})...");
$task->executeTask(); $task = $task->executeTask();
$ex = $task->getExecutionException(); $ex = $task->getExecutionException();
if ($ex) { if ($ex) {