Skip to content

Per-process backoff algorithm #4

Description

@jhunt

Right now, init has a single backoff clock. I would rather each process has its own.

  1. When a process starts, we set a deadline for the process, as now + nap.
  2. If a process dies before its deadline, double nap, up to 6,400 ms.
  3. If a deadline passes and a process is not running, start it and go to (1).
  4. If a deadline passes and a process is running, halve its nap, down to 100ms, and set a new deadline.

This should cause the backoff algorithm to "back back on" and allow a process that dies after hours to be restarted almost immediately, rather than continually delay and delay because of a perfect memory of previous failures.

(Note: this either means that we sleep in a single supervisor thread for min(what's left on deadlines), or we spin up a process per supervised process. If we opt for the latter, I'd really like to change the names of the processes to something like "init--", making it trivial to SIGHUP a single supervised process. Also, we should probably "relay" some signals to child processes.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions