5647ca2bbb
Fixes: https://github.com/hashicorp/consul/issues/3676 This fixes a bug were registering an agent with a non-existent ACL token can prevent other services registered with a good token from being synced to the server when using `acl_enforce_version_8 = false`. ## Background When `acl_enforce_version_8` is off the agent does not check the ACL token validity before storing the service in its state. When syncing a service registered with a missing ACL token we fall into the default error handling case (https://github.com/hashicorp/consul/blob/master/agent/local/state.go#L1255) and stop the sync (https://github.com/hashicorp/consul/blob/master/agent/local/state.go#L1082) without setting its Synced property to true like in the permission denied case. This means that the sync will always stop at the faulty service(s). The order in which the services are synced is random since we iterate on a map. So eventually all services with good ACL tokens will be synced, this can however take some time and is influenced by the cluster size, the bigger the slower because retries are less frequent. Having a service in this state also prevent all further sync of checks as they are done after the services. ## Changes This change modify the sync process to continue even if there is an error. This fixes the issue described above as well as making the sync more error tolerant: if the server repeatedly refuses a service (the ACL token could have been deleted by the time the service is synced, the servers were upgraded to a newer version that has more strict checks on the service definition...). Then all services and check that can be synced will, and those that don't will be marked as errors in the logs instead of blocking the whole process. |
||
---|---|---|
.. | ||
ae | ||
cache | ||
cache-types | ||
checks | ||
config | ||
connect | ||
consul | ||
debug | ||
exec | ||
local | ||
metadata | ||
mock | ||
pool | ||
proxycfg | ||
proxyprocess | ||
router | ||
structs | ||
systemd | ||
token | ||
xds | ||
acl.go | ||
acl_endpoint.go | ||
acl_endpoint_legacy.go | ||
acl_endpoint_legacy_test.go | ||
acl_endpoint_test.go | ||
acl_test.go | ||
agent.go | ||
agent_endpoint.go | ||
agent_endpoint_test.go | ||
agent_test.go | ||
bindata_assetfs.go | ||
blacklist.go | ||
blacklist_test.go | ||
catalog_endpoint.go | ||
catalog_endpoint_test.go | ||
check.go | ||
config.go | ||
connect_auth.go | ||
connect_ca_endpoint.go | ||
connect_ca_endpoint_test.go | ||
coordinate_endpoint.go | ||
coordinate_endpoint_test.go | ||
dns.go | ||
dns_test.go | ||
enterprise_delegate_oss.go | ||
event_endpoint.go | ||
event_endpoint_test.go | ||
health_endpoint.go | ||
health_endpoint_test.go | ||
http.go | ||
http_oss.go | ||
http_oss_test.go | ||
http_test.go | ||
intentions_endpoint.go | ||
intentions_endpoint_test.go | ||
keyring.go | ||
keyring_test.go | ||
kvs_endpoint.go | ||
kvs_endpoint_test.go | ||
notify.go | ||
notify_test.go | ||
operator_endpoint.go | ||
operator_endpoint_test.go | ||
prepared_query_endpoint.go | ||
prepared_query_endpoint_test.go | ||
remote_exec.go | ||
remote_exec_test.go | ||
retry_join.go | ||
retry_join_test.go | ||
session_endpoint.go | ||
session_endpoint_test.go | ||
sidecar_service.go | ||
sidecar_service_test.go | ||
signal_unix.go | ||
signal_windows.go | ||
snapshot_endpoint.go | ||
snapshot_endpoint_test.go | ||
status_endpoint.go | ||
status_endpoint_test.go | ||
testagent.go | ||
testagent_test.go | ||
translate_addr.go | ||
txn_endpoint.go | ||
txn_endpoint_test.go | ||
ui_endpoint.go | ||
ui_endpoint_test.go | ||
user_event.go | ||
user_event_test.go | ||
util.go | ||
util_test.go | ||
watch_handler.go | ||
watch_handler_test.go |