Bug 1145046
| Summary: | Task doesn't exit on abortWorkItem in one transaction with Oracle | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Retired] JBoss BPMS Platform 6 | Reporter: | Toshiya Kobayashi <tkobayas> | ||||
| Component: | jBPM Core | Assignee: | Alessandro Lazarotti <alazarot> | ||||
| Status: | CLOSED EOL | QA Contact: | Dominik Hanak <dhanak> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | high | ||||||
| Version: | 6.0.2 | CC: | bpms-support, kverlaen, mbaluch | ||||
| Target Milestone: | ER2 | ||||||
| Target Release: | 6.1.0 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2020-03-27 20:07:32 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
This is likely because of FlushMode.COMMIT which is set in AbstractPersistenceContextManager.getCommandScopedEntityManager(). https://github.com/droolsjbpm/drools/blob/master/drools-persistence-jpa/src/main/java/org/drools/persistence/jpa/AbstractPersistenceContextManager.java#L102 As the flush is deferred to commit, LocalHTWorkItemHandler.abortWorkItem() fails to find the Task. https://github.com/droolsjbpm/jbpm/blob/master/jbpm-human-task/jbpm-human-task-workitems/src/main/java/org/jbpm/services/task/wih/LocalHTWorkItemHandler.java#L98 I observed that MySQL executes insert SQL on em.persist() anyway so this issue is not reproducible with MySQL. this has been recently enhanced so flush mode will not be set to commit any longer. The change that allowed to do this was to replace entity listeners based callbacks to trigger protobuf serialization with transaction synchronization based. That is coming with next product build so marking it as modified to get retested. Thanks Toshiya for the reproducer! I have tested this and there is no more status 'Reserved'. Only task id 1 had status 'Exited' as requested: A process instance started : pid = 1 A process instance started : pid = 2 Task Entry A process instance started : pid = 3 taskId = 1, status = Exited A process instance started : pid = 4 A process instance started : pid = 5 Verified in BPMS 6.1.0.ER2. Maciej, can you please provide commit links with the fix? Thanks. here it is: droolsjbpm-knowledge master: https://github.com/droolsjbpm/droolsjbpm-integration/commit/4681a5b9eee3e67ea17f5c9d0e8cae2d10f0fc10 6.2.x: https://github.com/droolsjbpm/droolsjbpm-integration/commit/4681a5b9eee3e67ea17f5c9d0e8cae2d10f0fc10 drools master: https://github.com/droolsjbpm/drools/commit/9d8797a5ae954fbe9bb649243ea226cd1271b6eb https://github.com/droolsjbpm/drools/commit/ea24f95dded68338932d9437a3ba0d37cc9e10bd 6.2.x: https://github.com/droolsjbpm/drools/commit/9d8797a5ae954fbe9bb649243ea226cd1271b6eb https://github.com/droolsjbpm/drools/commit/ea24f95dded68338932d9437a3ba0d37cc9e10bd jbpm master: https://github.com/droolsjbpm/jbpm/commit/d561b42122dbb0b6efb05f0bde844e1bac57a3a9 6.2.x: https://github.com/droolsjbpm/jbpm/commit/d561b42122dbb0b6efb05f0bde844e1bac57a3a9 |
Created attachment 939936 [details] jBPM6Ex57_task_parallel_oracle_mvn.zip Description of problem: When a Task is added and aborted in one transaction, the Task doesn't exit so left as 'Reserved'. I confirmed this issue with Oracle. A Task properly exits in case of H2 and MySQL. Steps to Reproduce: You don't need to set up Oracle. ProcessMainJPATest points at our internal lab Oracle so you can access to it as long as you are inside VPN (the db is slow though). 1. Unzip attached jBPM6Ex57_task_parallel_oracle_mvn.zip 2. Edit pom.xml to meet your filepath of <systemPath> for ojdbc6.jar <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>11.2.0</version> <scope>system</scope> <systemPath>/home/tkobayas/workspace711/jBPM6Ex57_task_parallel_oracle_mvn/lib/ojdbc6.jar</systemPath> </dependency> 3. mvn test Actual results: You will see output like this A process instance started : pid = 1 Task Entry A process instance started : pid = 2 taskId = 1, status = Reserved Task Entry A process instance started : pid = 3 taskId = 2, status = Reserved A process instance started : pid = 4 Task Entry A process instance started : pid = 5 taskId = 3, status = Reserved This test uses a parallel gateway so sometimes it finishies without adding a Task but you will likely see some "taskId = 2, status = Reserved" logs as it runs with 5 loops. Expected results: status is 'Exited'