l.s.w.h.HAProxyStatusView : class documentation

Part of lp.services.webapp.haproxy View In Hierarchy

View implementing the HAProxy probe URL.

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 __init__ Undocumented
Method __call__ Return 200 or going down status depending on the global flag.
def __init__(self, context, request):
Undocumented
def __call__(self):
Return 200 or going down status depending on the global flag.
API Documentation for Launchpad, generated by pydoctor at 2019-03-25 00:00:04.