consul-esm icon indicating copy to clipboard operation
consul-esm copied to clipboard

Allow configuring NodeHealthRefreshInterval

Open magec opened this issue 1 year ago • 5 comments

I am working on a project where several nodes come and go pretty fast, was testing consul-esm reaping functionality an saw that the de-registering is only triggered after two health status updates, the first one that sets it to critical, and then it waits for a second one to trigger the de-registering. To speed this up I needed NodeHealthRefreshInterval to be configurable.

This change makes it configurable while maintaining the default value it had before it also adds some documentation explaining this 'use case'.

Without this, if you configure consul-esm with:

node_reconnect_timeout = "5m"

The 'non responding' node will be kept registered until 1 hour passes. Changing node_health_refresh_interval value and setting it to, let's say:

node_health_refresh_interval = "10s"

will deregister the node after (at most) 5m 10s. I have personally tested this behavior.

magec avatar Feb 16 '24 07:02 magec

Change looks good. Please add how have you tested it?

absolutelightning avatar Feb 19 '24 07:02 absolutelightning

I added a test for this parameter, the same way it is done for the rest of the exported config ones (this link) . What else do you need?

magec avatar Feb 19 '24 07:02 magec

I added a test for this parameter, the same way it is done for the rest of the exported config ones (this link) . What else do you need?

I was asking about manual tests. If you have done any? Please add in description.

absolutelightning avatar Feb 20 '24 02:02 absolutelightning

Added some comments!

magec avatar Feb 20 '24 09:02 magec

Any chance this could be merged? asking for a friend.

magec avatar Sep 13 '24 08:09 magec