Created attachment 791783 [details] server log excerpt Description of problem: I have a simple process: Start -> Timer -> Script Task -> End. When the Timer duration is set to 0s, the behaviour gets... strange. Sometimes, I get an exception stacktrace (see attachment). In this case, the instance finishes. Processinstanceinfo table does not contain this instance, processinstancelog has a record of this instance as completed. Nodeinstancelog table contains only records of the instance after leaving the timer node. Start node information and information about entering the timer node are missing. Sometimes, I get no stack trace, but the instance never finishes. Processinstanceinfo table has a record of this instance, processinstancelog has a record of this instance as active. Nodeinstancelog table contains only records of the instance up to and including entering the timer node. This instance never finishes. Sometimes, I get no stack trace, the instance finishes. Processinstanceinfo table might or might not contain this instance, processinstancelog has two records of this instance - one as active, one as completed. Nodeinstancelog table contains records for the whole instance, all the nodes, entering and leaving. I'd like to add that 0s is not an invalid input, just perhaps one not used often. Version-Release number of selected component (if applicable): BPMS 6.0 ER2
fixed by making sure that timer is scheduled only when transaction is successfully committed. Commit on 6.0.x: https://github.com/droolsjbpm/jbpm/commit/079feb43af255453e1d63f0deaab16a2dd00129c
I haven't seen the original failures so far with ER4, so this is definitely going in the right direction, but I got this: ERROR [org.jbpm.process.instance.timer.TimerManager] Error when executing timer job: javax.persistence.TransactionRequiredException: No active JTA transaction on joinTransaction call ... (the instance was aborted during the timer node execution) and this: WARN [com.arjuna.ats.jta] ARJUNA016029: SynchronizationImple.afterCompletion - failed for org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@aac4909 with exception: java.lang.NullPointerException ... (the instance stayed active, in the timer node) and this: WARN [com.arjuna.ats.arjuna] ARJUNA012127: TwoPhaseCoordinator.afterCompletion - returned failure for SynchronizationImple< 0:ffff0a22039f:cb13c7:525e3b90:562, org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@aac4909 > ... (the instance stayed active, in the timer node, and all instances after it as well) and this a few times: INFO [org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl] HHH000106: Forcing container resource cleanup on transaction completion WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: null ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] The result set is closed. INFO [org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] IJ000311: Throwable from unregister connection: java.lang.IllegalStateException: Trying to return an unknown connection2! org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@2e5064f8 ... (the instance stayed active, in the timer node) Most of the instances run fine though.
Created attachment 812793 [details] stacktraces in ER4
Created attachment 813271 [details] process used
fix applied to secure that timers are handled properly. There were some issues with transaction management and http request which was unified and moved to use of TransactionInterceptor instead of TransactionServletListener from seam-transaction. jbpm master: https://github.com/droolsjbpm/jbpm/commit/739a65a69f3351af37c16200bc23af7dd0c1f436 6.0.x https://github.com/droolsjbpm/jbpm/commit/1efad93554db5c9d860b357da4b3a97c56a4f74e droolsjbpm-integration master https://github.com/droolsjbpm/droolsjbpm-integration/commit/0d197efba9e5d50588ee7fabb4224cb69e016644 6.0.x https://github.com/droolsjbpm/droolsjbpm-integration/commit/c09a273e7cf5730654312c956058844f4a3cc49d jbpm-console-ng master: https://github.com/droolsjbpm/jbpm-console-ng/commit/ddcf398459de473c890646d9a334551bd0f3df60 6.0.x: https://github.com/droolsjbpm/jbpm-console-ng/commit/427c45d55d7d0749cc8d874422212af4bb3d8e9c kie-wb-distributions master https://github.com/droolsjbpm/kie-wb-distributions/commit/1675620b519fbfc539b0f1a7b754c45b34d0f136 6.0.x https://github.com/droolsjbpm/kie-wb-distributions/commit/4136aa9f53edf7ec51db4c1fa9132a5ebeb594f0
Verified with ER5. As a sidenote - in 4 out of 30 such instances I got a variation on "Could not commit session: javax.persistence.TransactionRequiredException: No active JTA transaction on joinTransaction call" (one with "ERROR [org.jbpm.process.instance.timer.TimerManager]") in the server log. These instances though finished just fine and look the same as the rest in the gui, nothing seems wrong in the database either. So this seems like a pretty harmless issue with unfortunate logging rather than the original bug. I'll put this into a separate, lower severity BZ. Thanks!