You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During our testing phase we are continually updating the policies and testing enforcement of various domain objects. We noticed that very intermittently we will get an ArgumentOfRangeException with the following call stack:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at Casbin.Model.DefaultPolicyStore.Iterator.GetNext(IPolicyValues& values)
at Casbin.Enforcer.InternalEnforce[TRequest,TPolicy](EnforceContext& context, TRequest& requestValues)
at Casbin.Enforcer.InternalEnforce[TRequest](EnforceContext& context, TRequest& requestValues)
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
at Casbin.Enforcer.EnforceAsync[TRequest](EnforceContext context, TRequest requestValues)
For now we are going to just try to retry the exception, but looking for a more stable solution here, thanks!
The text was updated successfully, but these errors were encountered:
[request_definition]
r = sub, dom, obj, act
[policy_definition]
p = sub, dom, act
[role_definition]
g = _, _
g2 = _, _
g3 = _, _
[policy_effect]
e = some(where (p.eft == allow))
[matchers]
m = g(r.sub, p.sub) && (g2(r.dom, p.dom) || r.obj == p.dom) && g3(r.act, p.act)
The code that throws the exception is simply calling EnforceAsync(subject, domain, obj, action); on the IEnforcer.
It is very intermittent but occurs during our integration test phase where we are constantly reading and writing the policy. So there isn't a straight-forward reproducible steps, you would have to potentially create something that was updating the policy in the background while enforcing in another thread.
During our testing phase we are continually updating the policies and testing enforcement of various domain objects. We noticed that very intermittently we will get an ArgumentOfRangeException with the following call stack:
For now we are going to just try to retry the exception, but looking for a more stable solution here, thanks!
The text was updated successfully, but these errors were encountered: