@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.

Surface task queue temporary failure rate in Daemon console

Summary: Fixes T3557. One thing which made T3557 kind of a mess was the lack of information about progress through temporary failures. Add a column which records a task's last failure time, and surface it in the console.

Test Plan: {F51277}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3557

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

+36 -1
+6
resources/sql/patches/20130723.taskstarttime.sql
··· 1 + ALTER TABLE {$NAMESPACE}_worker.worker_activetask 2 + ADD failureTime INT UNSIGNED; 3 + 4 + ALTER TABLE {$NAMESPACE}_worker.worker_activetask 5 + ADD KEY `key_failuretime` (`failureTime`); 6 +
+23 -1
src/applications/daemon/controller/PhabricatorDaemonConsoleController.php
··· 11 11 'dateModified > %d', 12 12 time() - (60 * 15)); 13 13 14 + $failed = id(new PhabricatorWorkerActiveTask())->loadAllWhere( 15 + 'failureTime > %d', 16 + time() - (60 * 15)); 17 + 14 18 $completed_info = array(); 15 19 foreach ($completed as $completed_task) { 16 20 $class = $completed_task->getTaskClass(); ··· 36 40 ); 37 41 } 38 42 43 + if ($failed) { 44 + $rows[] = array( 45 + phutil_tag('em', array(), pht('Temporary Failures')), 46 + count($failed), 47 + null, 48 + ); 49 + } 50 + 39 51 $completed_table = new AphrontTableView($rows); 40 52 $completed_table->setNoDataString( 41 53 pht('No tasks have completed in the last 15 minutes.')); ··· 52 64 'n', 53 65 )); 54 66 67 + $completed_header = id(new PhabricatorHeaderView()) 68 + ->setHeader(pht('Recently Completed Tasks (Last 15m)')); 69 + 55 70 $completed_panel = new AphrontPanelView(); 56 - $completed_panel->setHeader(pht('Recently Completed Tasks (15m)')); 57 71 $completed_panel->appendChild($completed_table); 58 72 $completed_panel->setNoBackground(); 59 73 ··· 149 163 $queued_panel->appendChild($queued_table); 150 164 $queued_panel->setNoBackground(); 151 165 166 + $crumbs = $this->buildApplicationCrumbs(); 167 + $crumbs->addCrumb( 168 + id(new PhabricatorCrumbView()) 169 + ->setName(pht('Console'))); 170 + 152 171 $nav = $this->buildSideNavView(); 153 172 $nav->selectFilter('/'); 154 173 $nav->appendChild( 155 174 array( 175 + $crumbs, 176 + $completed_header, 156 177 $completed_panel, 157 178 $daemon_header, 158 179 $daemon_table, ··· 164 185 $nav, 165 186 array( 166 187 'title' => pht('Console'), 188 + 'dust' => true, 167 189 )); 168 190 } 169 191
+3
src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php
··· 2 2 3 3 final class PhabricatorWorkerActiveTask extends PhabricatorWorkerTask { 4 4 5 + protected $failureTime; 6 + 5 7 private $serverTime; 6 8 private $localTime; 7 9 ··· 132 134 } catch (Exception $ex) { 133 135 $this->setExecutionException($ex); 134 136 $this->setFailureCount($this->getFailureCount() + 1); 137 + $this->setFailureTime(time()); 135 138 136 139 $retry = $worker->getWaitBeforeRetry($this); 137 140 $retry = coalesce(
+4
src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
··· 1471 1471 'type' => 'php', 1472 1472 'name' => $this->getPatchPath('20130716.archivememberlessprojects.php'), 1473 1473 ), 1474 + '20130723.taskstarttime.sql' => array( 1475 + 'type' => 'sql', 1476 + 'name' => $this->getPatchPath('20130723.taskstarttime.sql'), 1477 + ), 1474 1478 ); 1475 1479 } 1476 1480 }