consul/agent
James Phillips d9a6e2a901
Makes server manager shift away from failed servers from Serf events.
Because this code was doing pointer equality checks, it would work for
the case of a failed attempted RPC because the objects are from the
manager itself:

https://github.com/hashicorp/consul/blob/v1.0.3/agent/consul/rpc.go#L283-L302

But the pointer check would always fail for events coming in from the
Serf path because the server object is newly-created:

https://github.com/hashicorp/consul/blob/v1.0.3/agent/router/serf_adapter.go#L14-L40

This means that we didn't proactively shift RPC traffic away from a
failed server, we'd have to wait for an RPC to fail, which exposes
the error to the calling client.

By switching over to a name check vs. a pointer check we get the correct
behavior. We added a DEBUG log as well to help observe this behavior during
integrated testing.

Related to #3863 since the fix here needed the same logic duplicated, owing
to the complicated atomic stuff.

/cc @dadgar for a heads up in case this also affects Nomad.
2018-02-05 17:56:00 -08:00
..
ae ae: do not trigger on Resume while holding the lock 2017-10-23 10:56:05 +02:00
checks Gets rid of named return parameters. 2018-01-25 14:29:50 -08:00
config Add enterprise default config section 2018-02-05 13:33:59 -08:00
consul remove golint warnings 2018-01-28 22:40:13 +04:00
exec fix go vet issue 2017-10-25 19:30:35 +02:00
local Adds a longer retry period for the AE deferred output test. 2017-11-08 18:10:13 -08:00
metadata fix refactoring 2018-01-28 22:48:21 +04:00
mock agent: replace docker check 2017-07-18 20:24:38 +02:00
pool Makes RPC handling more robust when rolling servers. (#3561) 2017-10-10 15:19:50 -07:00
router Makes server manager shift away from failed servers from Serf events. 2018-02-05 17:56:00 -08:00
structs Changes "TLS" to "GRPCUseTLS" since it only applies to GRPC checks. 2018-02-02 17:29:34 -08:00
systemd agent: notify systemd after JoinLAN (#2121) 2017-06-21 06:43:55 +02:00
token Adds secure introduction for the ACL replication token. (#3357) 2017-08-03 15:39:31 -07:00
acl.go local state: tests compile 2017-10-23 10:56:03 +02:00
acl_endpoint.go Moves ACL disabled response logic down into endpoints. 2017-11-29 18:36:52 -08:00
acl_endpoint_test.go Moves ACL disabled response logic down into endpoints. 2017-11-29 18:36:52 -08:00
acl_test.go local state: tests compile 2017-10-23 10:56:03 +02:00
agent.go Merge pull request #3845 from 42wim/tagfix 2018-02-05 16:18:00 -08:00
agent_endpoint.go Moves the coordinate fetch after the ACL check. 2018-01-19 15:25:22 -08:00
agent_endpoint_test.go Moves ACL disabled response logic down into endpoints. 2017-11-29 18:36:52 -08:00
agent_test.go Adds a before/after test for #3845. 2018-02-05 16:18:29 -08:00
bindata_assetfs.go Updates web assets to latest. 2018-01-22 14:46:07 -08:00
blacklist.go Adds the ability to blacklist specific HTTP endpoints. (#3252) 2017-07-10 13:51:25 -07:00
blacklist_test.go Adds the ability to blacklist specific HTTP endpoints. (#3252) 2017-07-10 13:51:25 -07:00
catalog_endpoint.go Using labels 2017-12-21 20:30:29 -08:00
catalog_endpoint_test.go local state: address review comments 2017-10-23 10:56:04 +02:00
check.go Decouple the code that executes checks from the agent 2017-10-25 11:18:07 +02:00
config.go Fixes API client for ScriptArgs and updates documentation. (#3589) 2017-10-18 11:28:39 -07:00
coordinate_endpoint.go Moves coordinate disabled logic down into endpoints. 2017-11-29 18:36:52 -08:00
coordinate_endpoint_test.go Moves coordinate disabled logic down into endpoints. 2017-11-29 18:36:52 -08:00
dns.go fix refactoring 2018-01-28 22:53:30 +04:00
dns_test.go remove golint warnings 2018-01-28 22:40:13 +04:00
event_endpoint.go agent: consolidate handling of 405 Method Not Allowed (#3405) 2017-09-25 23:11:19 -07:00
event_endpoint_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
health_endpoint.go agent: consolidate handling of 405 Method Not Allowed (#3405) 2017-09-25 23:11:19 -07:00
health_endpoint_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
http.go Using labels 2017-12-21 20:30:29 -08:00
http_oss.go Creates HTTP endpoint registry. 2017-11-29 18:36:52 -08:00
http_oss_test.go Creates HTTP endpoint registry. 2017-11-29 18:36:52 -08:00
http_test.go Wraps HTTP mux to ban all non-printable characters from paths. 2017-12-20 15:47:53 -08:00
keyring.go agent: move agent/consul/structs to agent/structs 2017-08-09 14:32:12 +02:00
keyring_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
kvs_endpoint.go agent: drop status code comments 2017-08-23 22:36:23 +02:00
kvs_endpoint_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
notify.go agent: move NotifyGroup into the agent pkg 2017-06-21 05:42:39 +02:00
notify_test.go agent: move NotifyGroup into the agent pkg 2017-06-21 05:42:39 +02:00
operator_endpoint.go Move autopilot to a standalone package 2017-12-11 16:45:33 -08:00
operator_endpoint_test.go Move autopilot to a standalone package 2017-12-11 16:45:33 -08:00
prepared_query_endpoint.go Fixes crash where body was optional for PQ endpoint (it is not). 2018-01-10 09:33:49 -08:00
prepared_query_endpoint_test.go agent: consolidate handling of 405 Method Not Allowed (#3405) 2017-09-25 23:11:19 -07:00
remote_exec.go Decouple the code that executes checks from the agent 2017-10-25 11:18:07 +02:00
remote_exec_test.go Replace time.Now().Sub(x) with time.Since(x) 2017-10-17 20:38:24 +02:00
retry_join.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
retry_join_test.go vendor: update go-discover (#3634) 2017-10-31 17:03:54 -05:00
session_endpoint.go Works around mapstructure behavior to enable sessions with no checks. 2017-12-14 09:07:56 -08:00
session_endpoint_test.go Works around mapstructure behavior to enable sessions with no checks. 2017-12-14 09:07:56 -08:00
snapshot_endpoint.go agent: consolidate handling of 405 Method Not Allowed (#3405) 2017-09-25 23:11:19 -07:00
snapshot_endpoint_test.go agent: consolidate handling of 405 Method Not Allowed (#3405) 2017-09-25 23:11:19 -07:00
status_endpoint.go agent: consolidate handling of 405 Method Not Allowed (#3405) 2017-09-25 23:11:19 -07:00
status_endpoint_test.go agent: consolidate handling of 405 Method Not Allowed (#3405) 2017-09-25 23:11:19 -07:00
testagent.go Adds HTTP/2 support to Consul's HTTPS server. (#3657) 2017-11-07 15:06:59 -08:00
testagent_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
translate_addr.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
txn_endpoint.go agent: consolidate handling of 405 Method Not Allowed (#3405) 2017-09-25 23:11:19 -07:00
txn_endpoint_test.go agent: consolidate handling of 405 Method Not Allowed (#3405) 2017-09-25 23:11:19 -07:00
ui_endpoint.go agent: consolidate handling of 405 Method Not Allowed (#3405) 2017-09-25 23:11:19 -07:00
ui_endpoint_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
user_event.go local state: tests compile 2017-10-23 10:56:03 +02:00
user_event_test.go local state: tests compile 2017-10-23 10:56:03 +02:00
util.go Improves user lookup error message. 2018-01-26 07:56:44 -08:00
util_test.go Move check definition to a sub-struct 2017-11-01 14:54:46 -07:00
watch_handler.go Decouple the code that executes checks from the agent 2017-10-25 11:18:07 +02:00
watch_handler_test.go Cleans up import sorting. 2017-10-21 20:08:11 -07:00