Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per-process backoff algorithm #4

Open
jhunt opened this issue Sep 21, 2019 · 0 comments
Open

Per-process backoff algorithm #4

jhunt opened this issue Sep 21, 2019 · 0 comments
Assignees

Comments

@jhunt
Copy link
Member

jhunt commented Sep 21, 2019

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.)

@jhunt jhunt self-assigned this Sep 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant