envoyproxy/envoy

Setting runtime fraction of numerator 0 and FractionalPercent_HUNDRED for RequestMirrorPolicy ends up using FractionalPercent_THOUSAND

Open

#8.299 geöffnet am 19. Sept. 2019

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (5.373 Forks)batch import
bughelp wanted

Repository-Metriken

Stars
 (27.997 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 8T) (378 gemergte PRs in 30 T)

Beschreibung

Title: Setting runtime fraction of numerator 0 and FractionalPercent_HUNDRED for RequestMirrorPolicy ends up using FractionalPercent_THOUSAND

Description: We are rolling our RequestMirrorPolicy, we set the path within the Runtime Fraction but not the default like so:

RuntimeFraction: &core.RuntimeFractionalPercent{
    RuntimeKey: policy.RuntimeKey,
    DefaultValue: &envoytype.FractionalPercent{
      Numerator:   0,
      Denominator: envoytype.FractionalPercent_HUNDRED,
    },
},

But as I change the runtime flag, I am noticing that the runtime fraction is using FractionalPercent_TEN_THOUSAND as a denominator based on the aggregated stats.

Since envoytype.FractionalPercent_HUNDRED is the default value, I believe envoy is treating DefaultValue as a nil value and exercising this code path: https://github.com/envoyproxy/data-plane-api/blob/master/envoy/api/v2/route/route.proto#L640-L645

Contributor Guide