]
Enrique González Martínez commented on WFLY-12457:
--------------------------------------------------
When the ejb timers datastore is not accesible and a timer is in timeout it causes an
inconsistency. first the timer is never retried, and in memory is in a end state.
Single action timer is not triggered automatically after a DB outage,
requires server restart
---------------------------------------------------------------------------------------------
Key: WFLY-12457
URL:
https://issues.jboss.org/browse/WFLY-12457
Project: WildFly
Issue Type: Bug
Components: EJB
Reporter: Enrique González Martínez
Assignee: Cheng Fang
Priority: Major
A timer is created with the {{timerService.createSingleActionTimer(..)}} method. When the
database is down at the time this timer expires, the timer execution fails with the
following ERROR:
{noformat}
09:01:32,968 ERROR [org.jboss.as.ejb3.timer] (EJB timer-thread-pool - 4) WFLYEJB0502:
Exception checking if timer [id=7ac2a79a-daa8-46fb-afa1-9e72f39a5b01
timedObjectId=ejb-timer-db-outage.ejb-timer-db-outage.TimeoutExample auto-timer?:false
persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@7071c87c
initialExpiration=Fri Aug 09 09:01:32 MDT 2019 intervalDuration(in milli sec)=0
nextExpiration=Fri Aug 09 09:01:32 MDT 2019 timerState=ACTIVE
info=timer_1565362882955_10000] should run: java.sql.SQLException:
javax.resource.ResourceException: IJ000453: Unable to get managed connection for
java:jboss/datasources/ejb_timer
at
org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:159)
at
org.jboss.as.connector.subsystems.datasources.WildFlyDataSource.getConnection(WildFlyDataSource.java:64)
at
org.jboss.as.ejb3.timerservice.persistence.database.DatabaseTimerPersistence.shouldRun(DatabaseTimerPersistence.java:405)
at
org.jboss.as.ejb3.timerservice.TimerServiceImpl.shouldRun(TimerServiceImpl.java:1148)
at org.jboss.as.ejb3.timerservice.TimerTask.run(TimerTask.java:133)
at
org.jboss.as.ejb3.timerservice.TimerServiceImpl$Task$1.run(TimerServiceImpl.java:1304)
at
org.wildfly.extension.requestcontroller.RequestController$QueuedTask$1.run(RequestController.java:494)
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)
at org.jboss.threads.JBossThread.run(JBossThread.java:485)
Caused by: javax.resource.ResourceException: IJ000453: Unable to get managed connection
for java:jboss/datasources/ejb_timer
at
org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:690)
at
org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:440)
at
org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:789)
at
org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:151)
... 10 more
{noformat}
EXPECTATION: The timer should fire once the DB is accessible again.
RESULT: The timer is not executed even after the DB connection has been restored.
After a server restart, the timer is executed again.
Note: This issue has originally been reported in the context of RHPAM as RHPAM-2180 where
processes with timers get stuck after a DB outage. The relevant [jBPM
code|https://github.com/kiegroup/jbpm/blob/master/jbpm-services/jbpm-serv...]
calls {{timerService.createSingleActionTimer(..)}}.