Homec4science

Make parsing of daemon PIDs more robust

Authored by epriestley <git@epriestley.com> on Feb 17 2015, 23:20.

Description

Make parsing of daemon PIDs more robust

Summary:
In production on the cluster, we get output like this:

  1 process1
 22 process2
333 process3

That is, the PIDs are right-aligned. In this case, the explode(...) splits the line " 1 process1" on the first space, and we end up with an empty PID.

We later try to kill PID 0, which kills us.

Instead, trim.

Also, be slightly more liberal in splitting.

Test Plan: Ran phd stop --force in production, saw daemons get killed instead of the process itself.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

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

Details

Committed
epriestley <git@epriestley.com>Feb 17 2015, 23:20
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUe99f07349e7d: Phabricator OAuth - tweak Phabricator Oauth adapter
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUe2cdf9f89c88: Make parsing of daemon PIDs more robust (authored by epriestley <git@epriestley.com>).Feb 17 2015, 23:20