opa: fatal error: concurrent map iteration and map write
Short description
We are running OPA Version: 0.48.0 in Kubernetes and occasionally we get pods restarting with the following error:
fatal error: concurrent map iteration and map write
goroutine 23576821 [running]:
github.com/open-policy-agent/opa/bundle.compileModules(0xc1fcf4e140, {0x15a63a0, 0xc2ab0cea60}, 0x7f?, 0x1597040?, 0x0)
/src/bundle/store.go:766 +0x19d
github.com/open-policy-agent/opa/bundle.activateBundles(0xc0040a4848)
/src/bundle/store.go:453 +0x7b5
The recurrence of this event currently is one pod every 2-3 days.
I have attached the complete panic log below.
Expected behavior
Opa should not panic and exit
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 19 (13 by maintainers)
Commits related to this issue
- 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 thos... — committed to ashutosh-narkar/opa by ashutosh-narkar a year ago
- 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 thos... — committed to ashutosh-narkar/opa by ashutosh-narkar a year ago
- 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 thos... — committed to open-policy-agent/opa by ashutosh-narkar a year ago
@scarlier we’ve merged this change which should resolve the issue you reported.
I have changed the definition of
LivenessandReadinessprobes to happen less frequently and to not run on the same schedule to minimize the moments when there are both executing at the same time. restarts have not happened in more than 40h now so there is something here for sure.