envoyproxy/envoy

runtime config "re2.max_program_size.error_level" doesn't apply to stats matcher

Open

#21.056 geöffnet am 27. Apr. 2022

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: runtime flag "re2.max_program_size.error_level" doesn't apply to stats_matcher config

Description:

I have this simple envoy config

{
  "admin": {
    "access_log_path": "/dev/null",
    "address": {
      "socket_address": {
        "address": "0.0.0.0",
        "port_value": 8001
      }
    }
  },
  "layered_runtime": {
    "layers": [
      {
        "name": "static-runtime",
        "static_layer": {
          "re2.max_program_size.error_level": 1000
        }
      }
    ]
  },
  "stats_config": {
    "stats_matcher": {
      "inclusion_list": {
        "patterns": [
          {
            "safe_regex": {
              "google_re2": {},
              "regex": "cluster.(metadata-cluster|iam-cluster|service-control-cluster|backend-cluster-sample-backend-s3fctubhaq-uc.a.run.app_443).upstream_rq_(reset|timeout|[1-5]xx)"
            }
          }
        ]
      }
    }
  }
}

Envoy failed to load it with following error:

2022-04-27 12:21:28.927][1601282][critical][main] [external/envoy/source/server/server.cc:117] error initializing configuration '/tmp/envoy333.json': regex 'cluster.(metadata-cluster|iam-cluster|service-control-cluster|backend-cluster-sample-backend-s3fctubhaq-uc.a.run.app_443).upstream_rq_(reset|timeout|[1-5]xx)' RE2 program size of 187 > max program size of 100 set for the error level threshold. Increase configured max program size if necessary.
[2022-04-27 12:21:28.927][1601282][info][main] [external/envoy/source/server/server.cc:939] exiting
regex 'cluster.(metadata-cluster|iam-cluster|service-control-cluster|backend-cluster-sample-backend-s3fctubhaq-uc.a.run.app_443).upstream_rq_(reset|timeout|[1-5]xx)' RE2 program size of 187 > max program size of 100 set for the error level threshold. Increase configured max program size if necessary.

It seems that layered_runtime runtime is applied after stats_matcher. so its flag of ""re2.max_program_size.error_level" to 1000 was not applied.

It happens with top of tree, release 1.22.0

But it did not happen with release 1.21.1

Repro steps:

Contributor Guide