open-consul/agent
Aestek 5647ca2bbb [Fix] Services sometimes not being synced with acl_enforce_version_8 = false (#4771)
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.
2019-01-04 10:01:50 -05:00
..
ae
cache
cache-types
checks
config Documentation and changes for verify_server_hostname (#5069) 2018-12-06 13:51:49 -08:00
connect agent: fix formatting 2018-11-07 02:16:03 -08:00
consul [Travis][UnstableTests] Fixed unstable tests in travis (#5013) 2018-12-12 12:09:42 -08:00
debug fix comment typos (#4890) 2018-11-02 12:00:39 -05:00
exec
local [Fix] Services sometimes not being synced with acl_enforce_version_8 = false (#4771) 2019-01-04 10:01:50 -05:00
metadata New ACLs (#4791) 2018-10-19 12:04:07 -04:00
mock
pool
proxycfg
proxyprocess
router
structs acl: add stub hooks to support some plumbing in enterprise (#4951) 2018-11-13 15:35:54 -06:00
systemd
token re-add Connect multi-dc config changes 2018-10-19 08:41:03 -07:00
xds New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_endpoint.go Adds documentation for the new ACL APIs (#4851) 2018-10-31 15:11:51 -07:00
acl_endpoint_legacy.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_endpoint_legacy_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_endpoint_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
agent.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
agent_endpoint.go Doc changes for 1.4 Final (#4870) 2018-11-13 13:43:53 +00:00
agent_endpoint_test.go connect: remove additional trust-domain validation (#4934) 2018-11-12 20:20:12 +00:00
agent_test.go
bindata_assetfs.go Release v1.4.0 2018-11-14 22:37:47 +00:00
blacklist.go
blacklist_test.go
catalog_endpoint.go
catalog_endpoint_test.go dns: implements prefix lookups for DNS TTL (#4605) 2018-10-19 08:41:04 -07:00
check.go
config.go
connect_auth.go connect: remove additional trust-domain validation (#4934) 2018-11-12 20:20:12 +00:00
connect_ca_endpoint.go
connect_ca_endpoint_test.go
coordinate_endpoint.go
coordinate_endpoint_test.go
dns.go dns: implements prefix lookups for DNS TTL (#4605) 2018-10-19 08:41:04 -07:00
dns_test.go Fixed another list of unstable unit tests in travis (#4915) 2018-11-20 11:27:26 +00:00
enterprise_delegate_oss.go
event_endpoint.go
event_endpoint_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
health_endpoint.go
health_endpoint_test.go
http.go ui: serve /robots.txt when UI is enabled. (#5089) 2018-12-17 19:35:03 +01:00
http_oss.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
http_oss_test.go Fixed another list of unstable unit tests in travis (#4915) 2018-11-20 11:27:26 +00:00
http_test.go New command: consul debug (#4754) 2018-10-19 08:41:03 -07:00
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 Fixed another list of unstable unit tests in travis (#4915) 2018-11-20 11:27:26 +00:00
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 New ACLs (#4791) 2018-10-19 12:04:07 -04:00
util.go
util_test.go
watch_handler.go
watch_handler_test.go