mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
rego: Parse store modules iff modules set on the Rego object
Currently we parse store modules irrespective of whether there are modules on the Rego object. This will result in the compilation of those modules which triggers the bundle activation flow. Now as part of the module compilation we interact with the compiler's modules and run compilation on the input modules. If let's say there are concurrent health check requests (ie. /v1/health), this could result in a race during the compilation process while working with the compiler's modules. This change avoids this situation by skipping parsing of the store modules when none are set on the Rego object. The assumption this change makes is that while using the rego package the compiler and store are kept in-sync. Fixes: #5868 Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
This commit is contained in:
@@ -1038,7 +1038,6 @@ func TestCompileV1Observability(t *testing.T) {
|
||||
"timer_rego_partial_eval_ns",
|
||||
"timer_rego_query_compile_ns",
|
||||
"timer_rego_query_parse_ns",
|
||||
"timer_rego_module_parse_ns",
|
||||
"timer_server_handler_ns",
|
||||
"counter_disk_read_keys",
|
||||
"timer_disk_read_ns",
|
||||
|
||||
Reference in New Issue
Block a user