Defect #2725
closedAdding automatic roles by tree structures fails and the task blocks other new automatic roles
100%
Description
Tested on 10.7.2 and 10.8.1
Steps to reproduce:- create an organization (in my case "Organization three")
- create at least 2 users in this organization ("threeOneUser", "threeSecondUser")
- create a role which assigns account in a system (can be virtual) ("RoleForThree")
- create an automatic role by organizational structure ("RoleForThree" without recursion on "OrganizationThree")
Result: One of the users doesn't have the role. The task ProcessAutomaticRoleByTreeTaskExecutor stays Waiting and no other task of this type can start => no other new automatic roles are assigned.
Note: It doesn't happen always, but in cca 50 % cases.
Task scheduler:
Events:
Detail of the failed request:
java.lang.IllegalArgumentException: Concept is not executed [CONCEPT], identity role identifier is empty. at org.springframework.util.Assert.notNull(Assert.java:198) at eu.bcvsolutions.idm.core.scheduler.task.impl.ProcessAutomaticRoleByTreeTaskExecutor.lambda$null$0(ProcessAutomaticRoleByTreeTaskExecutor.java:270) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at eu.bcvsolutions.idm.core.scheduler.task.impl.ProcessAutomaticRoleByTreeTaskExecutor.lambda$end$1(ProcessAutomaticRoleByTreeTaskExecutor.java:278) at java.lang.Iterable.forEach(Iterable.java:75) at eu.bcvsolutions.idm.core.scheduler.task.impl.ProcessAutomaticRoleByTreeTaskExecutor.end(ProcessAutomaticRoleByTreeTaskExecutor.java:263) at eu.bcvsolutions.idm.core.scheduler.task.impl.ProcessAutomaticRoleByTreeTaskExecutor.end(ProcessAutomaticRoleByTreeTaskExecutor.java:91) at eu.bcvsolutions.idm.core.scheduler.api.service.AbstractLongRunningTaskExecutor.notifyEnd(AbstractLongRunningTaskExecutor.java:293) at eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager.lambda$completeEvent$13(DefaultEntityEventManager.java:1431) at java.util.ArrayList.forEach(ArrayList.java:1257) at eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager.completeEvent(DefaultEntityEventManager.java:1429) at eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager.completeEvent(DefaultEntityEventManager.java:1408) at eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager.process(DefaultEntityEventManager.java:252) at eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager.process(DefaultEntityEventManager.java:177) at eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager$$FastClassBySpringCGLIB$$1694e58f.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) at eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager$$EnhancerBySpringCGLIB$$389cc354.process(<generated>) at eu.bcvsolutions.idm.core.model.event.processor.event.EntityEventExecuteProcessor.process(EntityEventExecuteProcessor.java:52) at eu.bcvsolutions.idm.core.api.event.AbstractEntityEventProcessor.onApplicationEvent(AbstractEntityEventProcessor.java:239) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:372) at eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager.process(DefaultEntityEventManager.java:250) at eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager.process(DefaultEntityEventManager.java:177) at eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager$2.run(DefaultEntityEventManager.java:615) at eu.bcvsolutions.idm.core.config.DelegatingTransactionContextRunnable.run(DelegatingTransactionContextRunnable.java:39) at org.springframework.security.concurrent.DelegatingSecurityContextRunnable.run(DelegatingSecurityContextRunnable.java:84) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
Files
Related issues
Updated by Alena Peterová almost 4 years ago
- Subject changed from Automatic roles by tree structures fail and the task blocks other automatic roles to Adding automatic roles by tree structures fails and the task blocks other new automatic roles
- Description updated (diff)
Updated by Radek Tomiška almost 4 years ago
- Status changed from New to In Progress
- Target version set to 10.8.2
Updated by Radek Tomiška over 3 years ago
- Related to Task #2444: Implement waiting for the completion of the LRT after all asynchronous events added
Updated by Radek Tomiška over 3 years ago
- Status changed from In Progress to Needs feedback
- Assignee changed from Radek Tomiška to Vít Švanda
- % Done changed from 0 to 90
- Affected versions 10.6.0, 10.6.1, 10.6.2, 10.6.3, 10.6.4, 10.7.0, 10.7.1, 10.6.5, 10.6.6, 10.8.0 added
I fixed transactional usage, when long running task ends after last role request is processed. Long running task needs to see all commited role requests (and concepts).
Commit:
https://github.com/bcvsolutions/CzechIdMng/commit/e5bdeb2b066f7eb8a86e1561702d36434036a775
Could you provide me a feedback, please?
Updated by Vít Švanda over 3 years ago
- Assignee changed from Vít Švanda to Ondrej Husník
I did review and tested it. As target system I used a DB table and organization with 5 users. I created / deleted automatic role more the 30 times (in many variants). Everything works correctly. Thanks for fix this bug.
Updated by Ondrej Husník over 3 years ago
I did some additional tests. I worked with 10 identities and VS system. I repeatedly performed several ways of removing and reassigning of auto roles, such as changing work position, terminating/initializing contracts or deleting/creating auto role. I wasn't able to reproduce the original bug after the fix. Before fix I was able to induce this problem at the first attempt. Looks good.
Updated by Ondrej Husník over 3 years ago
- Status changed from Needs feedback to Resolved
- Assignee changed from Ondrej Husník to Radek Tomiška
Updated by Radek Tomiška over 3 years ago
- Status changed from Resolved to Closed
- % Done changed from 90 to 100
Version 10.8.2 released.