Yelp / pgctl

Manage sets of developer services -- "playground control"
http://pgctl.rtfd.org
MIT License
32 stars 15 forks source link

Force kill any unsupervised processes at the start #222

Closed chriskuehl closed 2 years ago

chriskuehl commented 2 years ago

Currently pgctl start will crash with a confusing error message if there are any processes holding the s6 lock (but no s6-supervise command running). This is happening a few times per day according to our telemetry and we sometimes get reports about the hard-to-understand and hard-to-fix error.

After this change, any unsupervised processes (detected via both s6 lock file and environment variable tracing) will be terminated if the service is unsupervised. This will reduce errors from pgctl and confusing errors in cases where the orphaned process is holding a resource (like a port) that causes the new process to crash loop.