coreos/fleet — pull request #380 by bcwaldon (2014-05-02 16:12:10+00:00)
Title: Rework Agent startup/shutdown procedure

There are two notable changes here along with some general cleanup:

1. On startup, an Agent will walk through all Jobs in the cluster looking for any Jobs that are scheduled locally. The Agent will load (and possibly start) these Jobs before beginning normal operation. This is helpful in the event that a fleet process crashes and restarts relatively quickly.

2. Agents no longer clear their machine state or reschedule their jobs on graceful shutdown. This enables a machine to reboot for an upgrade without causing major churn in the cluster. The Engine will still reschedule things off of the Agent if it notices the state expires due to a lapsing TTL.

We need two more things for the second change noted above to be useful:
1. The Agent's TTL needs to be increased to something greater than the average reboot time of a CoreOS machine
2. The Agent needs to use the machine-id vs the boot-id so that the Agent can find its jobs when it comes back up after a reboot.