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

Allow daemons to be terminated in the absence of MySQL

Summary: Fixes T6842. Allow the daemons to always be terminated, even if MySQL is down. I was hoping to be able to optionally enable this behavior with the `--force` flag, but this seems messy.

Test Plan:
```lang=bash
> ./bin/phd start
Freeing active task leases...
Freed 1 task lease(s).
Preparing to launch daemons.
NOTE: Logs will appear in '/var/tmp/phd/log/daemons.log'.

Starting daemons as phd
Launching daemon "PhabricatorRepositoryPullLocalDaemon".
Starting daemons as phd
Launching daemon "PhabricatorGarbageCollectorDaemon".
Starting daemons as phd
Launching daemon "PhabricatorTaskmasterDaemon".
Done.

> service mysql stop
mysql stop/waiting

> ./bin/phd stop
Interrupting daemon 'PhabricatorRepositoryPullLocalDaemon' (4263)...
Interrupting daemon 'PhabricatorGarbageCollectorDaemon' (4271)...
Interrupting daemon 'PhabricatorTaskmasterDaemon' (4287)...
Daemon 4263 exited.
Daemon 4271 exited.
Daemon 4287 exited.
```

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6842

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

+10 -5
+10 -5
src/infrastructure/daemon/control/PhabricatorDaemonReference.php
··· 32 32 $ref->pid = idx($dict, 'pid'); 33 33 $ref->start = idx($dict, 'start'); 34 34 35 - $ref->daemonLog = id(new PhabricatorDaemonLog())->loadOneWhere( 36 - 'daemon = %s AND pid = %d AND dateCreated = %d', 37 - $ref->name, 38 - $ref->pid, 39 - $ref->start); 35 + try { 36 + $ref->daemonLog = id(new PhabricatorDaemonLog())->loadOneWhere( 37 + 'daemon = %s AND pid = %d AND dateCreated = %d', 38 + $ref->name, 39 + $ref->pid, 40 + $ref->start); 41 + } catch (AphrontQueryException $ex) { 42 + // Ignore the exception. We want to be able to terminate the daemons, 43 + // even if MySQL is down. 44 + } 40 45 41 46 return $ref; 42 47 }