Hide Forgot
Created attachment 810016 [details] console log Duplicate entry 'Administrator' for key 'PRIMARY' when RuntimeManager is used by multiple threads. See the whole console log in attachment. 2013-10-09 16:49:43,113 INFO [DefaultMessageGenerator] Starting to generate... 2013-10-09 16:49:44,344 WARN [SqlExceptionHelper] SQL Error: 1062, SQLState: 23000 2013-10-09 16:49:44,344 WARN [SqlExceptionHelper] SQL Error: 1062, SQLState: 23000 2013-10-09 16:49:44,344 ERROR [SqlExceptionHelper] Duplicate entry 'Administrator' for key 'PRIMARY' 2013-10-09 16:49:44,344 ERROR [SqlExceptionHelper] Duplicate entry 'Administrator' for key 'PRIMARY' 2013-10-09 16:49:44,345 WARN [SqlExceptionHelper] SQL Error: 1062, SQLState: 23000 2013-10-09 16:49:44,345 ERROR [SqlExceptionHelper] Duplicate entry 'Administrator' for key 'PRIMARY' To reproduce: 1.) git clone git://git.app.eng.bos.redhat.com/jbossqe-process-flood.git 2.) make sure that you are on company vpn to download all required maven artifacts 3.) make sure that you have local MySQL instance with clean database bpms, user bpms, password bpms (according to file mysql-localhost.xml) 4.) Run the test: cd jbossqe-process-flood/bpms-6.x ./execute_scenario.sh -Dscenario=HumanTask_startProcess_Java -Dthreads=4 -DruntimeManager=PerProcessInstance -s ../mysql-localhost.xml It can be either concurrency problem in runtime manager or bad usage of it. In any case this should not happen and more informative error message would be better.
the main issue with this was that attempt to insert users/groups by user group callback was not secured to be thread safe and thus when several task were tried to be inserted at the same time for same users/groups caused the failure. Fix was applied to ensure that only single thread can perform the insertion and rest will wait and rely on already done operation jbpm master: https://github.com/droolsjbpm/jbpm/commit/e2af85494576f7d9ffd20cec58d8688bdda91e22 6.0.x https://github.com/droolsjbpm/jbpm/commit/8e5de869436695bafa36e3a2dd6d5a6061b2432b
Maciej, Do you have a test for this somewhere? Of was this particularly hard to test?
Marco, I used the jbossqe-process-flood as reproducer for this issue. Besides that I haven't created any junit test as it is tricky simulate that as junit test which essentially can fail with false results many times and thus I relied on jbossqe-process-flood only.
Verified in BPMS 6 ER5 (6.0.0-redhat-6). One of the commands I used to verify: ./execute_scenario.sh -Dscenario=HumanTask_Java -Dthreads=4 -DruntimeManager=PerProcessInstance -s ../mysql-localhost.xml