envoyproxy / java-control-plane

Java implementation of an Envoy gRPC control plane
Apache License 2.0
293 stars 136 forks source link

cache: allow configuring the SimpleCache to ignore resource hints #56

Closed snowp closed 6 years ago

snowp commented 6 years ago

As per https://github.com/envoyproxy/data-plane-api/blob/master/XDS_PROTOCOL.md the control plane may ignore the resource hints and instead send all known resources. This PR makes this behavior configurable.

We've found that when adding a new EDS cluster to the snapshot the EDS resource won't get sent down on the initial Snapshot push because the watch is triggered with the resource hints set by Envoy prior to the new snapshot being set. Because the new resource is missing from the resource hints it's filtered out and won't get sent down until a new Snapshot is generated.

The addition of this feature deals let's us deal with this issue, and since we generate the exact set of resources that should be sent to Envoy we don't get any benefit from the resource hints anyways.

codecov-io commented 6 years ago

Codecov Report

Merging #56 into master will increase coverage by 0.05%. The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #56      +/-   ##
============================================
+ Coverage     95.19%   95.24%   +0.05%     
- Complexity      105      107       +2     
============================================
  Files            11       11              
  Lines           416      421       +5     
  Branches         33       34       +1     
============================================
+ Hits            396      401       +5     
  Misses           14       14              
  Partials          6        6
Impacted Files Coverage Δ Complexity Δ
.../io/envoyproxy/controlplane/cache/SimpleCache.java 100% <100%> (ø) 28 <4> (+2) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update adf1fb6...7ae2163. Read the comment docs.

snowp commented 6 years ago

gonna close this out since it turns out this wasn't sufficient to fix our issue - i'll follow up with whatever solution we arrive at