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

Services should not be "ready" if they're continually crashing #208

Open
chriskuehl opened this issue May 29, 2019 · 0 comments
Open

Services should not be "ready" if they're continually crashing #208

chriskuehl opened this issue May 29, 2019 · 0 comments

Comments

@chriskuehl
Copy link
Contributor

A service which keeps crashing but has a ready check that's exiting 0 will show as ready:

$ cat playground/foo/run
#!/bin/bash
exec pgctl-poll-ready bash -c 'sleep 1 && exit 1'
$ cat playground/foo/ready
#!/bin/bash
exit 0
$ pgctl start
[pgctl] Starting: foo
[pgctl] Started: foo
$ pgctl status
 ● foo: ready
   └─ pid: 28346, 0 seconds

In real life this often occurs when the service is crashing continually with an EADDRINUSE error because there's already an (orphaned) process bound to that port from a previous pgctl incantation, but the ready check succeeds because it can hit the status endpoint of the (orphaned, old!) process.

This one is kind of tricky to solve since we really have no way to deal with crashes / restarts in pgctl (s6 just restarts them forever), so I don't know that we can actually fix this. This would be on my wish-list for a pgctl replacement though, since this causes us a lot of confusion.

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