1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-23 05:01:13 +01:00

In "bin/repository reparse", continue on "PhabricatorWorkerPermanentFailureException"

Summary:
Fixes T13315. See that task for discussion.

Without `--background`, we currently treat this as a catastrophic failure, but it's relatively routine for some repository states. We can safely continue reparsing other steps.

Test Plan: Ran `bin/repository reparse --all X --message` with commits faked to all be unreachable. Got warnings instead of a hard failure on first problem.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13315

Differential Revision: https://secure.phabricator.com/D20588
This commit is contained in:
epriestley 2019-06-18 08:00:07 -07:00
parent aba7c98bae
commit 731b45d818

View file

@ -252,12 +252,24 @@ final class PhabricatorRepositoryManagementReparseWorkflow
); );
foreach ($classes as $class) { foreach ($classes as $class) {
PhabricatorWorker::scheduleTask( try {
$class, PhabricatorWorker::scheduleTask(
$spec, $class,
array( $spec,
'priority' => PhabricatorWorker::PRIORITY_IMPORT, array(
)); 'priority' => PhabricatorWorker::PRIORITY_IMPORT,
));
} catch (PhabricatorWorkerPermanentFailureException $ex) {
// See T13315. We expect some reparse steps to occasionally raise
// permanent failures: for example, because they are no longer
// reachable. This is a routine condition, not a catastrophic
// failure, so let the user know something happened but continue
// reparsing any remaining commits.
echo tsprintf(
"<bg:yellow>** %s **</bg> %s\n",
pht('WARN'),
$ex->getMessage());
}
} }
$progress->update(1); $progress->update(1);