-
Bug
-
Resolution: Done
-
Major
-
3.0.8.Final, 4.0.0.Alpha7
-
None
-
None
We encountered an issue with EJB timers stopping randomly if the container is under load. Sometimes the timers get stalled right after deployment without firing at all. Sometimes the timers work fine for a couple of days before they suddenly stop working. The timers are defined using the @Scheduled annotation.
We found out that the reason for the randomly stopping timers is a bug in the RequestController class which only appears if a maximum number of requests is configured in the request controller subsystem. If a timer is being triggered while the container has reached the request limit then the timer is put into a task queue to be processed later. However, the task queue is never checked for queued tasks if the request number goes down again. This leaves the timers stuck in the queue. Since every timer needs to reregister after it has been triggered, the timers appear to have stopped.
In old versions of the RequestController class from before release wildfly-core-1.0.0.Alpha14 it looks like the idea was to check for queued requests whenever a request finished (see here).