Comments (2)
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.
That certainly does explain it, thanks for taking the time to provide such a complete explanation!
from consul-alerts.
Related Issues (20)
- Support parametric notification profiles HOT 2
- Disable notifications with consul tags HOT 1
- email notifier: distinct email receivers based on consul service HOT 1
- Checks status "from [empty] to passing/critical"
- docker image does not send http-notification HOT 3
- 200 is not the only code that indicates success
- Config not updating
- Change the default URL where reads the config in consul "/consul-alerts/xxx" for another URL, for example "/consul-alerts-2/xxx"? HOT 1
- INFO[0003] Running for leader election... Error querying Consul agent: Unexpected response code: 403 (Permission denied) INFO[0003] Shutting down watcher --> Exit Code: 1 HOT 1
- Support JWT auth for HTTP notifier HOT 2
- Update docker image.
- (Stale) Reminder doesnt get deleted
- consul-alerts stops working after some time
- Can't connect to https consul endpoint
- Cant download consulalerts 0.6.0 HOT 1
- version display error
- Opsgenie notifier should allow to configure different target address
- http-endpoint-notifier : Possibility to add HTTP headers ?
- 'Running for leader election' repeating
- Incorrect policy given in README HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from consul-alerts.