Page MenuHomePhabricator

Use stdio, not signals, to heartbeat from the daemons
ClosedPublic

Authored by epriestley on Feb 22 2015, 2:06 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 11:43 PM
Unknown Object (File)
Mon, Nov 18, 10:33 PM
Unknown Object (File)
Fri, Nov 15, 10:58 AM
Unknown Object (File)
Sun, Nov 10, 5:37 PM
Unknown Object (File)
Wed, Nov 6, 9:03 PM
Unknown Object (File)
Sat, Oct 26, 8:10 PM
Unknown Object (File)
Oct 19 2024, 10:30 AM
Unknown Object (File)
Oct 15 2024, 10:05 PM
Subscribers

Details

Summary

Ref T7352. We currently run one overseer per daemon. I want to run one overseer for a group of daemons, to reduce the minimum memory footprint of an instance.

One barrier is how hang detection works: we detect daemon hangs by requiring them to send a periodic heartbeat. If a daemon doesn't heartbeat for a while, we assume it has hung and restart it.

Currently, this heartbeat is sent by having the daemons send SIGUSR1 to the overseer. When the overseer receives the signal, it extends the deadline for the next heartbeat.

However, the overseer can't tell where the signal came from. Right now it can only come from one place, but in a world where overseers run multiple daemons it could have come from any of the children.

Instead of using signals, this turns the daemon's stdout (which we already consume) into a structured message pipeline, and sends the heartbeat over stdout.

In a future diff, the overseer will be able to attriubute heartbeats to the correct child process.

Test Plan
  • Ran daemon in the raw, saw sensible output.
  • Made daemon use plain echo, saw output get wrapped.
  • Artificially set heartbeat deadline to 10 seconds, saw heartbeating daemons continue running and hung daemons restart.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Use stdio, not signals, to heartbeat from the daemons.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
btrahan edited edge metadata.
This revision is now accepted and ready to land.Feb 23 2015, 5:18 PM
This revision was automatically updated to reflect the committed changes.