Skip to content
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

Remove unused mutex in RuleGroup #381

Merged
merged 2 commits into from
Sep 5, 2022
Merged

Conversation

nacx
Copy link
Contributor

@nacx nacx commented Aug 31, 2022

The RuleGroup documentation says it is not concurrent safe, but it still has a RWMutex that is not properly used: the GetRules method locks for read but none of the write methods honor the mutex, so the lock is not effective and the method is not concurrent safe (as opposed to what its doc string says).

Should we just remove the lock and keep it concurrent unsafe as the RuleGroup type documentation says, and remove the sync overhead, or should I better make the RuleGroup concurrent safe and properly lock on writes?

Thank you for contributing to Coraza WAF, your effort is greatly appreciated
Before submitting check if what you want to add to coraza list meets quality standards before sending pull request. Thanks!

Note: that go.mod and go.sum can only be modified for tested dependency updates or justified new features.

Make sure that you've checked the boxes below before you submit PR:

Thanks for your PR ❤️

@jptosso
Copy link
Member

jptosso commented Aug 31, 2022

This is not used, and I think it should enhance performance.

Thank you for your contribution

@jptosso jptosso enabled auto-merge (squash) August 31, 2022 19:55
@jcchavezs
Copy link
Member

LGTM, would you port the change to v3/dev too?

@nacx nacx mentioned this pull request Aug 31, 2022
4 tasks
@nacx
Copy link
Contributor Author

nacx commented Aug 31, 2022

Sure: #384

@jcchavezs jcchavezs requested a review from jptosso August 31, 2022 20:14
@jptosso jptosso merged commit f95f41d into corazawaf:v2/master Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants