-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Enforcer hangs during multi-threaded modifications #336
Comments
Hi! Thank you for your feedback. I will review your points later and it would be helpful if you could provide more details like the error throw line. |
This happen in the Default PolicyStore.Node class in TryAddPolicy and TryRemovePolicy, lines 74 and 133 respectively. |
Hello! Any updates on this issue? |
@v-loboda @dmolochnikov can you provide stable reproduce steps? and also:
|
Hi, as I said before, it is hard to reprocude becase of multithreaded nature. You just need to modify your policies in several threads and read them simultaneously. In the first message I have pointed out several places that do not meet the multithreading requirements.
|
@v-loboda how to reproduce it stably? |
I would make a test case if I could reproduce the bug reliably. I was able to reproduce it several times by running the modification and receiving permissions in multiple threads and waiting for errors for a long time. Sometimes the error appeared within a few seconds. |
I definitely see similar issues. I didn't reproduce the deadlocking in a test yet, but I am seeing it as well. However, The PR I submitted here handles some issues as well as a test case that would fail prior in the same vein of concurrent access issues. #361 I would urge the team to investigate all usages of HashSet reading and writing as they are not thread safe. |
If you cannot reproduce it, it cannot be fixed. |
I believe this issue is indeed likely to occur, and it's very possible that the problem arises from making changes to the same Node while the Scanner is not interrupted. I will continue to try to find a way to consistently reproduce it, and once I find a method or have a new idea, I will reopen this issue. During the discussion, there are other potential issues, I will create a new issue to link them. |
🎉 This issue has been resolved in version 2.10.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Hi guys
We encountered a problem in an environment where intensive policy modification occurs. It's very difficult to reproduce, and I can't do it reliably.
We have rbac model, several nodes with synchronization via IWatcher and a lot of policy changes including removing them.
Sometimes, very rarely, we catch an error
Error Write lock may not be acquired with read lock held. This pattern is prone to deadlocks. Please ensure that read locks are released before taking a write lock. If an upgrade is necessary, use an upgrade lock in place of the read lock.
From my point of view, there are 3 problem pleces:
The text was updated successfully, but these errors were encountered: