Casbin.NET icon indicating copy to clipboard operation
Casbin.NET copied to clipboard

fix: concurrent access issues with HashSet<string>

Open seanamorosoamtote opened this issue 1 year ago • 4 comments
trafficstars

Came across issues that are similar to https://github.com/casbin/Casbin.NET/issues/336

Was able to create a concurrent update of the grouping policy which would trigger concurrent access errors. It would work OK with only 100, but once you hit 500 or greater it would fail almost 100% of the time.

I don't think this should go into master as-is, but one of your members can take what is here and make the appropriate changes to handle the access. You can remove my code changes and just use the test and models to see the test fail.

seanamorosoamtote avatar Jun 11 '24 18:06 seanamorosoamtote

@sagilio please review

casbin-bot avatar Jun 11 '24 18:06 casbin-bot

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 11 '24 18:06 CLAassistant

Thank you, I will try to reproduce the test failure scenario. The changes currently appear to be effective and correct, I think there might not be much need for further modifications.

sagilio avatar Jun 12 '24 02:06 sagilio

@seanamorosoamtote plz sign CLA:

image

hsluoyz avatar Jun 16 '24 03:06 hsluoyz

:tada: This PR is included in version 2.9.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Aug 11 '24 16:08 github-actions[bot]