mirror of https://github.com/status-im/consul.git
20eb0d3e94
In normal operations there is a read/write race related to request QueryOptions fields. An example race: WARNING: DATA RACE Read at 0x00c000836950 by goroutine 30: github.com/hashicorp/consul/agent/structs.(*ServiceConfigRequest).CacheInfo() /go/src/github.com/hashicorp/consul/agent/structs/config_entry.go:506 +0x109 github.com/hashicorp/consul/agent/cache.(*Cache).getWithIndex() /go/src/github.com/hashicorp/consul/agent/cache/cache.go:262 +0x5c github.com/hashicorp/consul/agent/cache.(*Cache).notifyBlockingQuery() /go/src/github.com/hashicorp/consul/agent/cache/watch.go:89 +0xd7 Previous write at 0x00c000836950 by goroutine 147: github.com/hashicorp/consul/agent/cache-types.(*ResolvedServiceConfig).Fetch() /go/src/github.com/hashicorp/consul/agent/cache-types/resolved_service_config.go:31 +0x219 github.com/hashicorp/consul/agent/cache.(*Cache).fetch.func1() /go/src/github.com/hashicorp/consul/agent/cache/cache.go:495 +0x112 This patch does a lightweight copy of the request struct so that the embedded QueryOptions fields that are mutated during Fetch() are scoped to just that one RPC. |
||
---|---|---|
.. | ||
catalog_datacenters.go | ||
catalog_datacenters_test.go | ||
catalog_list_services.go | ||
catalog_list_services_test.go | ||
catalog_services.go | ||
catalog_services_test.go | ||
config_entry.go | ||
config_entry_test.go | ||
connect_ca_leaf.go | ||
connect_ca_leaf_test.go | ||
connect_ca_root.go | ||
connect_ca_root_test.go | ||
discovery_chain.go | ||
discovery_chain_test.go | ||
health_services.go | ||
health_services_test.go | ||
intention_match.go | ||
intention_match_test.go | ||
mock_RPC.go | ||
node_services.go | ||
node_services_test.go | ||
prepared_query.go | ||
prepared_query_test.go | ||
resolved_service_config.go | ||
resolved_service_config_test.go | ||
rpc.go | ||
service_dump.go | ||
service_dump_test.go | ||
testing.go |