Git Product home page Git Product logo

Comments (2)

darkcrux avatar darkcrux commented on August 20, 2024

Basically how the health checks work is it waits for a change in the health checks and then triggers the health-check-notify logic which runs for ~60 seconds. This process is not concurrent and any change in the health check while the process is running will wait for it to finish before running the process again. Basically queueing up.

I tried to avoid a very long queue to run the health-check-notify process which would cause it to run for a long time in case the consul health changes very often (possibly flapping). So the fix was to allow only 1 process request to wait instead of having a queue.

Given that flapping sometimes occur in a system, I tried to avoid something like this:

(for a given 60 seconds)
consul triggered health check --> process runs for 60 seconds
consul triggered health check --> process waits then run another 60 seconds
consul triggered health check --> process waits then run another 60 seconds
consul triggered health check --> process waits then run another 60 seconds

This would end up with the process running for ~ 4 mins to check the health changes.

The solution I added was to have only one process waiting instead of a queue:

(for a given 60 seconds)
consul triggered health check --> process runs for 60 seconds
consul triggered health check --> process waits then run another 60 seconds
consul triggered health check --> replaces currently waiting process
consul triggered health check --> replaces currently waiting process

This then would prevent the consul health check flapping from queueing up and making the process run longer than necessary.

Basically it's just a log saying that "there's another health check change and there's already a health-check-notify process running and there's also another one waiting when it's done, so I'm not adding to the queue". (It needs a better description though or I should just remove it from the log).

Hope that explains it. :) I should probably remove that log. :)

from consul-alerts.

dpetzel avatar dpetzel commented on August 20, 2024

That certainly does explain it, thanks for taking the time to provide such a complete explanation!

from consul-alerts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.