-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data race warning detected upon starting Caddy #44
Comments
Interesting. I think the main issue here is that the action is mutating the rule which sounds odd to me as rules are persistent across the lifecycle of the WAF and we are mutating rules that contain |
Initialization of actions happen once in the WASM and mutate the rules, however evaluation are executed per transaction and mutating the rule shouldn't happen as it leads to race conditions and unexpected behaviours. See corazawaf/coraza-caddy#44.
Initialization of actions happen once in the WASM and mutate the rules, however evaluation are executed per transaction and mutating the rule shouldn't happen as it leads to race conditions and unexpected behaviours. See corazawaf/coraza-caddy#44.
Thank you for your report, fixed in #45 which implements @jcchavezs fix |
Thanks! Will build and try again later |
* chore: avoids mutating the rule during evaluation. Initialization of actions happen once in the WASM and mutate the rules, however evaluation are executed per transaction and mutating the rule shouldn't happen as it leads to race conditions and unexpected behaviours. See corazawaf/coraza-caddy#44. * chore: uses blank identifier to better analyse the API and mutations. * tests: improves coverage. * tests: adds more tests. * wip * chore: group errors. * tests: adds more coverage.
Hi! Our servers build Caddy with Go's data race detector and I've observed the following data race detections upon each server restart when any request comes in: https://gist.github.com/r3g-5z/19a4710c2a061c3248d27de4dde5ddae (logs are too long)
At the moment I'm setting up Coraza so my CRS is all default except for allowlisting the protocols HTTP/3 and HTTP/3.0 (
setvar:'tx.allowed_http_versions=HTTP/1.0 HTTP/1.1 HTTP/2 HTTP/2.0 HTTP/3 HTTP/3.0'
).This warning only occurs once each restart, but it is consistent.
We're building Caddy from the main branch instead of the latest tag, and running and building with Go 1.20 (
go version go1.20 linux/amd64
).The text was updated successfully, but these errors were encountered: