Find a file
Aestek eba1dd7856 Prevent status flap when re-registering a check (#4904)
Fixes point `#2` of: https://github.com/hashicorp/consul/issues/4903

When registering a service each healthcheck status is saved and restored (https://github.com/hashicorp/consul/blob/master/agent/agent.go#L1914) to avoid unnecessary flaps in health state.
This change extends this feature to single check registration by moving this protection in `AddCheck()` so that both `PUT /v1/agent/service/register` and `PUT /v1/agent/check/register` behave in the same idempotent way.

#### Steps to reproduce
1. Register a check :
```
curl -X PUT \
  http://127.0.0.1:8500/v1/agent/check/register \
  -H 'Content-Type: application/json' \
  -d '{
  "Name": "my_check",
  "ServiceID": "srv",
  "Interval": "10s",
  "Args": ["true"]
}'
```
2. The check will initialize and change to `passing`
3. Run the same request again
4. The check status will quickly go from `critical` to `passing` (the delay for this transission is determined by https://github.com/hashicorp/consul/blob/master/agent/checks/check.go#L95)
2019-01-07 13:53:03 -05:00
.circleci refresh cache key and fix comments 2019-01-03 22:57:40 -05:00
.github add codeowners for consul docs 2019-01-03 15:01:16 -05:00
acl
agent Prevent status flap when re-registering a check (#4904) 2019-01-07 13:53:03 -05:00
api Implement /v1/agent/health/service/<service name> endpoint (#3551) 2019-01-07 09:39:23 -05:00
bench
build-support
command Implement /v1/agent/health/service/<service name> endpoint (#3551) 2019-01-07 09:39:23 -05:00
connect connect: remove additional trust-domain validation (#4934) 2018-11-12 20:20:12 +00:00
demo
ipaddr
lib
logger
sentinel
service_os
snapshot
terraform
test
testrpc
testutil
tlsutil agent: honor when ca is set but verify_outgoing is disabled (#4826) 2018-12-17 09:56:18 -08:00
types
ui
ui-v2 add documentation on how to use ember-exam 2019-01-03 23:50:02 -05:00
vendor
version Put the tree in v1.4.1 dev mode 2018-11-14 16:56:48 -08:00
watch
website website: fix carousel bugs 2019-01-07 13:39:14 -05:00
.dockerignore
.gitattributes
.gitignore
.travis.yml
CHANGELOG.md Update CHANGELOG.md 2019-01-07 09:56:31 -05:00
GNUmakefile CA Provider Plugins (#4751) 2019-01-07 12:48:44 -05:00
INTERNALS.md
LICENSE
main.go
main_test.go
NOTICE.md
README.md
Vagrantfile

Consul Build Status Join the chat at https://gitter.im/hashicorp-consul/Lobby

Consul is a tool for service discovery and configuration. Consul is distributed, highly available, and extremely scalable.

Consul provides several key features:

  • Service Discovery - Consul makes it simple for services to register themselves and to discover other services via a DNS or HTTP interface. External services such as SaaS providers can be registered as well.

  • Health Checking - Health Checking enables Consul to quickly alert operators about any issues in a cluster. The integration with service discovery prevents routing traffic to unhealthy hosts and enables service level circuit breakers.

  • Key/Value Storage - A flexible key/value store enables storing dynamic configuration, feature flagging, coordination, leader election and more. The simple HTTP API makes it easy to use anywhere.

  • Multi-Datacenter - Consul is built to be datacenter aware, and can support any number of regions without complex configuration.

  • Service Segmentation - Consul Connect enables secure service-to-service communication with automatic TLS encryption and identity-based authorization.

Consul runs on Linux, Mac OS X, FreeBSD, Solaris, and Windows. A commercial version called Consul Enterprise is also available.

Please note: We take Consul's security and our users' trust very seriously. If you believe you have found a security issue in Consul, please responsibly disclose by contacting us at security@hashicorp.com.

Quick Start

An extensive quick start is viewable on the Consul website:

https://www.consul.io/intro/getting-started/install.html

Documentation

Full, comprehensive documentation is viewable on the Consul website:

https://www.consul.io/docs

Contributing

Thank you for your interest in contributing! Please refer to CONTRIBUTING.md for guidance.