Go to file
freddygv 0fb96afe31 Avoid potential deadlock using non-blocking send
Deadlock scenario:
    1. Due to scheduling, the state runner sends one snapshot into
    snapCh and then attempts to send a second. The first send succeeds
    because the channel is buffered, but the second blocks.
    2. Separately, Manager.Watch is called by the xDS server after
    getting a discovery request from Envoy. This function acquires the
    manager lock and then blocks on receiving the CurrentSnapshot from
    the state runner.
    3. Separately, there is a Manager goroutine that reads the snapshots
    from the channel in step 1. These reads are done to notify proxy
    watchers, but they require holding the manager lock. This goroutine
    goes to acquire that lock, but can't because it is held by step 2.

Now, the goroutine from step 3 is waiting on the one from step 2 to
release the lock. The goroutine from step 2 won't release the lock until
the goroutine in step 1 advances. But the goroutine in step 1 is waiting
for the one in step 3. Deadlock.

By making this send non-blocking step 1 above can proceed. The coalesce
timer will be reset and a new valid snapshot will be delivered after it
elapses or when one is requested by xDS.
2021-02-02 11:31:14 -07:00
.changelog chore: changelog for 9660 (#9668) 2021-01-29 16:08:39 +00:00
.circleci ci: fail cherrypick if git push fails (#9673) 2021-01-29 19:42:14 -05:00
.github ci: add script to check for .changelog file in PRs (#9641) 2021-02-01 18:51:52 -05:00
acl
agent Avoid potential deadlock using non-blocking send 2021-02-02 11:31:14 -07:00
api
bench
build-support
command config: make config.TestLoad_FullConfig use config.Load 2021-01-27 17:51:53 -05:00
connect
contributing contrib: Update contributing checklist for config 2021-01-27 17:52:54 -05:00
demo
grafana
internal
ipaddr
lib
logging
proto
sdk
sentinel
service_os
snapshot
terraform
test
testrpc
tlsutil Add flags to support CA generation for Connect (#9585) 2021-01-27 08:52:15 +01:00
types
ui ui: Adds unique-id helper (#9676) 2021-02-02 10:03:46 +00:00
vendor Merge pull request #9302 from hashicorp/dnephin/add-service-3 2021-01-28 16:59:41 -05:00
version
website website: add utm params for all cloud.hashi links 2021-02-02 09:09:16 -05:00
.dockerignore
.gitattributes
.gitignore
.golangci.yml
.hashibot.hcl
CHANGELOG.md Release 1.9.3 (#9680) 2021-02-01 13:34:44 -05:00
GNUmakefile
INTERNALS.md
LICENSE
NOTICE.md
README.md
Vagrantfile
codecov.yml
go.mod Merge pull request #9302 from hashicorp/dnephin/add-service-3 2021-01-28 16:59:41 -05:00
go.sum Merge pull request #9302 from hashicorp/dnephin/add-service-3 2021-01-28 16:59:41 -05:00
main.go
main_test.go
package-lock.json

README.md

Consul CircleCI Discuss

Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.

Consul provides several key features:

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

  • Service Mesh/Service Segmentation - Consul Connect enables secure service-to-service communication with automatic TLS encryption and identity-based authorization. Applications can use sidecar proxies in a service mesh configuration to establish TLS connections for inbound and outbound connections without being aware of Connect at all.

  • 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.

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

A few quick start guides are available on the Consul website:

Documentation

Full, comprehensive documentation is available on the Consul website:

https://www.consul.io/docs

Contributing

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