fly-proxy now respects health checks during autostart

Service-level checks let you define how the proxy determines if a machine is ready to serve traffic. These checks run at the proxy level and prevent traffic from being sent to unhealthy machines.

There was, however, an inconsistency in how the proxy used health check status. For the running machines health checks were acting as described in the documentation. In contrast, for the machines that the proxy started itself due to autostart=true configuration option, the proxy ignored health check status while a machine was still starting and forwarded a request to the machine as soon as it was able to establish a connection to it. This could’ve led to a few failed requests in apps that started listening on the socket before they were ready to handle requests.

This was a conscious decision to make sure a request gets forwarded to a machine as soon as possible.

With the recent improvements to how health checks are performed while a machine is still starting and to how fly-proxy interacts with Corrosion, our state propagation system, we believe it should now be fine to wait for health checks to pass before actually forwarding a request. And that’s what fly-proxy is doing now.

5 Likes

Will this fix the issue where autostart will keep starting new machines if the machine isn’t ready within 10 seconds?

This particular change alone - no. It just ensures that the proxy is consistent in how it treats health checks. I have some ideas how to make autostart more useful/reliable for slow-starting apps and gonna experiment with them soon.

1 Like