lua-resty-upstream-healthcheck icon indicating copy to clipboard operation
lua-resty-upstream-healthcheck copied to clipboard

Routing requests to all peers when they all down

Open eglinux opened this issue 7 years ago • 3 comments
trafficstars

Sometimes it happens that healthcheckers configuration gets spoiled. For example, when the new version of application has been deployed on the backend servers without respecting healthchecks on the balancer. In this case all peers will be switched to 'DOWN' state and nginx will return 502 error message for incoming requests. If balancer detects such issue it could just switch to default routing of all requests to all peers instead. In theory if all peers are down there is no big reason who shows the error message in situation when we have real problems with all our backend servers.

It is kind of protection from the fool. However, for example AWS application balancer applies it by default.

I have already made a fork and added this feature. You can have a look here: https://github.com/eglinux/lua-resty-upstream-healthcheck So, if you by chance find this way is ok - I can make a pull request. Thanks!

eglinux avatar Feb 16 '18 09:02 eglinux

@eglinux Yes, we should do it that way. Just be careful about performance :)

Pull requests welcome! And sorry for my late reply.

agentzh avatar Feb 26 '18 01:02 agentzh

Pull request is in place #52

eglinux avatar Feb 26 '18 11:02 eglinux

@eglinux Thanks!

agentzh avatar Feb 26 '18 22:02 agentzh