Go to file
R.B. Boyer 3804677570
server: suppress spurious blocking query returns where multiple config entries are involved (#12362)
Starting from and extending the mechanism introduced in #12110 we can specially handle the 3 main special Consul RPC endpoints that react to many config entries in a single blocking query in Connect:

- `DiscoveryChain.Get`
- `ConfigEntry.ResolveServiceConfig`
- `Intentions.Match`

All of these will internally watch for many config entries, and at least one of those will likely be not found in any given query. Because these are blends of multiple reads the exact solution from #12110 isn't perfectly aligned, but we can tweak the approach slightly and regain the utility of that mechanism.

### No Config Entries Found

In this case, despite looking for many config entries none may be found at all. Unlike #12110 in this scenario we do not return an empty reply to the caller, but instead synthesize a struct from default values to return. This can be handled nearly identically to #12110 with the first 1-2 replies being non-empty payloads followed by the standard spurious wakeup suppression mechanism from #12110.

### No Change Since Last Wakeup

Once a blocking query loop on the server has completed and slept at least once, there is a further optimization we can make here to detect if any of the config entries that were present at specific versions for the prior execution of the loop are identical for the loop we just woke up for. In that scenario we can return a slightly different internal sentinel error and basically externally handle it similar to #12110.

This would mean that even if 20 discovery chain read RPC handling goroutines wakeup due to the creation of an unrelated config entry, the only ones that will terminate and reply with a blob of data are those that genuinely have new data to report.

### Extra Endpoints

Since this pattern is pretty reusable, other key config-entry-adjacent endpoints used by `agent/proxycfg` also were updated:

- `ConfigEntry.List`
- `Internal.IntentionUpstreams` (tproxy)
2022-02-25 15:46:34 -06:00
.changelog server: suppress spurious blocking query returns where multiple config entries are involved (#12362) 2022-02-25 15:46:34 -06:00
.circleci connect: Update supported Envoy versions to include 1.19.3 and 1.18.6 2022-02-24 16:59:33 -08:00
.github Remove setup-qemu step from Docker build job (#12387) 2022-02-24 12:35:47 -08:00
.release Adding post-publish events to ci.hcl. 2022-02-17 16:54:36 +00:00
acl Refactor to make ACL errors more structured. (#12308) 2022-02-11 12:53:23 -08:00
agent server: suppress spurious blocking query returns where multiple config entries are involved (#12362) 2022-02-25 15:46:34 -06:00
api fix godoc comment for Namespaces client method 2022-02-18 04:15:55 +00:00
bench
build-support Fix build script (#12367) 2022-02-16 11:52:44 -08:00
command catalog: compare node names case insensitively in more places (#12444) 2022-02-24 16:54:47 -06:00
connect
contributing
docs Add 7th check registration flow to docs 2022-02-11 15:11:22 -05:00
grafana
internal
ipaddr
lib Vendor in rpc mono repo for net/rpc fork, go-msgpack, msgpackrpc. (#12311) 2022-02-14 09:45:45 -08:00
logging
proto streaming: split event buffer by key (#12080) 2022-01-28 12:27:00 +00:00
sdk raft: update to v1.3.5 (#12325) 2022-02-14 13:48:52 -06:00
sentinel
service_os
snapshot Vendor in rpc mono repo for net/rpc fork, go-msgpack, msgpackrpc. (#12311) 2022-02-14 09:45:45 -08:00
terraform
test connect: Update supported Envoy versions to include 1.19.3 and 1.18.6 2022-02-24 16:59:33 -08:00
testrpc
tlsutil
types
ui ui: PagedCollection component (#12404) 2022-02-25 10:01:08 +00:00
version
website connect: Update supported Envoy versions to include 1.19.3 and 1.18.6 2022-02-24 16:59:33 -08:00
.dockerignore
.gitattributes
.gitignore
.golangci.yml
CHANGELOG.md Add missing enhancement entries to appropriate spot in CHANGELOG (#12380) 2022-02-17 19:22:03 -08:00
Dockerfile Update docker image base to alpine:3.15 (#12276) 2022-02-04 13:56:39 -08:00
GNUmakefile ensure make dev target puts the newly constructed binary onto the PATH (#12318) 2022-02-11 10:45:37 -06:00
INTERNALS.md
LICENSE
NOTICE.md
README.md Adjust README header to work in light and dark modes 2022-02-07 16:46:46 -08:00
Vagrantfile
codecov.yml
go.mod server: suppress spurious blocking query returns where multiple config entries are involved (#12362) 2022-02-25 15:46:34 -06:00
go.sum server: suppress spurious blocking query returns where multiple config entries are involved (#12362) 2022-02-25 15:46:34 -06:00
main.go
main_test.go
package-lock.json

README.md

Consul logo Consul

Docker Pulls Go Report Card

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, macOS, FreeBSD, Solaris, and Windows and includes an optional browser based UI. 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. For contributions specifically to the browser based UI, please refer to the UI's README.md for guidance.