Part of lp.services.webapp.haproxy View In Hierarchy
HAProxy doesn't support programmatically taking servers in and our of rotation. It does however uses a probe URL that it scans regularly to see if the server is still alive. The /+haproxy is that URL for us.
If it times out or returns a non-200 status, it will take the server out of rotation, until the probe works again.
This allow us to send a signal (HUP) to the app servers when we want to restart them. The probe URL will then return 500 and the app server will be taken out of rotation. Once HAProxy reports that all connections to the app servers are finished, we can restart the server safely.
The returned result code when the server is going down can be configured through the haproxy_status_view.going_down_status configuration variable. It defaults to 500 (as set in lib/lp/services/config/schema-lazr.conf).
|Method||__call__||Return 200 or going down status depending on the global flag.|