Page MenuHomePhabricator

Query daemons across all hosts with `./bin/phd status --all`.
ClosedPublic

Authored by joshuaspence on Jun 12 2014, 7:15 AM.
Tags
None
Referenced Files
F14364419: D9497.id22897.diff
Fri, Dec 20, 2:23 PM
Unknown Object (File)
Wed, Dec 18, 4:39 PM
Unknown Object (File)
Wed, Dec 18, 4:39 PM
Unknown Object (File)
Wed, Dec 18, 4:39 PM
Unknown Object (File)
Wed, Dec 18, 4:39 PM
Unknown Object (File)
Sat, Dec 14, 3:39 AM
Unknown Object (File)
Thu, Dec 5, 6:10 PM
Unknown Object (File)
Mon, Dec 2, 11:22 PM

Details

Summary

Ref T4209. Currently, ./bin/phd status prints a table showing the daemons that are executing on the current host. It would be useful to be able to conventiently query the daemons running across all hosts. This would also (theoretically) make it possible to conditionally start daemons on a host depending upon the current state and on the daemons running on other hosts.

Test Plan
> ./bin/phd status --all
ID      Host                    PID     Started                     Daemon                                            Arguments
   18          phabricator     6969   Jun 12 2014, 4:44:22 PM     PhabricatorTaskmasterDaemon                       
   17          phabricator     6961   Jun 12 2014, 4:44:19 PM     PhabricatorTaskmasterDaemon                       
   16          phabricator     6955   Jun 12 2014, 4:44:15 PM     PhabricatorTaskmasterDaemon                       
   15          phabricator     6950   Jun 12 2014, 4:44:14 PM     PhabricatorTaskmasterDaemon                       
   14          phabricator     6936   Jun 12 2014, 4:44:13 PM     PhabricatorGarbageCollectorDaemon                 
   13          phabricator     6931   Jun 12 2014, 4:44:12 PM     PhabricatorRepositoryPullLocalDaemon

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

joshuaspence retitled this revision from to Query daemons across all hosts with `./bin/phd status --all`..
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.

This needs a bit of touching up, but let me know what you think.

src/applications/daemon/management/PhabricatorDaemonManagementStatusWorkflow.php
10–11

Maybe this doesn't need a separate flag to control this... Possibly we could just show one unified view which combines information from the database with information from the PID files.

14–18

See above.

75

This is getting out of control... Additionally, it's hard to predict how long some of the fields would be (particularly "Host" and "Arguments").

90

$daemon-getArgv() is a little too verbose here. Possibly we could filter out all of the normal argv stuff and just display anything custom? Whether or not this is easier to filter is another question.

epriestley edited edge metadata.

This seems reasonable to me.

This revision is now accepted and ready to land.Jun 16 2014, 6:42 PM

I was doing some additional work on this and thinking of unifying the local and global view into one... @epriestley, wdyt?

I'm fine with pretty much whatever. I think this is a solid improvement on the status quo, and integrating the views would be a further improvement. You could land this for now and do that later.

src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php
49

Unused.

50

Not an array / file is not read. Probably intended to be newFromFile()?

51

$ref not defined.

51

Unused.

58

This never returns.

src/infrastructure/daemon/control/PhabricatorDaemonReference.php
34–38

Static function, should be $ref.