[jboss-jira] [JBoss JIRA] (WFLY-13386) Hung process instances and associated server.log WARN "Failed to reinstate timer 'kie-server.kie-server.EJBTimerScheduler' "

Enrique González Martínez (Jira) issues at jboss.org
Mon May 11 02:30:00 EDT 2020


    [ https://issues.redhat.com/browse/WFLY-13386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14089850#comment-14089850 ] 

Enrique González Martínez commented on WFLY-13386:
--------------------------------------------------

# It does not require cluster neither in DB or wildfly (just 1 database and 1 wildfly instance)

# it requires the refresh task to be active


The race condition is caused because both of them are triggering the function registers a timer The problem happens

when the registering in wildfly memory is not finish and the registering the timer in the database has already finish. If the order

is changed it might happen that the refresh task is trying to register the timer even before the registering the timer in wildfly memory
causing this duplicate resource problem. This is because the operation is not atomic (registering a timer in memory + registering in databse)
the trace would be like

# registering timer in memory (main thread)
# registering timer in database (main thread)
# read timer from database (timer thread refresh task)
# register timer in memory (timer thread refresh task))
# register timer in resource (timer thread refresh task))
# register time in resource (main thread)

so refresh task is being executed at the same time as the timer thread is trying to register the timer.
keep in mind that operations in db are not linked to ejb tx (it is its own lifecycle)




> Hung process instances and associated server.log WARN "Failed to reinstate timer 'kie-server.kie-server.EJBTimerScheduler' "
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WFLY-13386
>                 URL: https://issues.redhat.com/browse/WFLY-13386
>             Project: WildFly
>          Issue Type: Bug
>            Reporter: Enrique González Martínez
>            Assignee: Enrique González Martínez
>            Priority: Major
>
> When a timer is reloaded for the first time in other node there are no listeners attached to it causing this problem (only in cluster environments with db timers)
> {code}
> 2020-04-15 16:43:57,733 WARN  [org.jboss.as.ejb3.timer] (Timer-1) WFLYEJB0161: Failed to reinstate timer 'kie-server.kie-server.EJBTimerScheduler' (id=33170e5f-3b34-4503-8796-9b5e6871c074) from its persistent state: java.lang.NullPointerException
> 	at org.jboss.as.ejb3.timerservice.persistence.database.DatabaseTimerPersistence$RefreshTask.run(DatabaseTimerPersistence.java:851)
> 	at java.util.TimerThread.mainLoop(Timer.java:555)
> 	at java.util.TimerThread.run(Timer.java:505)
> {code}



--
This message was sent by Atlassian Jira
(v7.13.8#713008)



More information about the jboss-jira mailing list