You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment reporting jobs are executed by the ManagedExecutorService (MES) without any timeout, thus tasks may run forever.
Unlike other application servers' MES implementations, TomEE's MES does not have a "hung-task-threshold" config parameter.
How to detect hung tasks?
A scheduled method could check the "jobs" table for BUSY jobs with "jobdate" before some date. These jobs can be either in the MES's queue or are currently executed.
How to stop tasks? MES does not offer any access methods to get the queue list or the current tasks in execution. The only way to manipulate tasks from outside is via the Future returned by the submit method of the MES. Futures offer a cancel() method.
Thus, a possible implementation could be to cache the submitted Futures (association with the Job via a Map<Future,Job>, hoping that TomEE's Future implementation has a proper equals()/hashCode() ...). This has to be done in a Singleton-EJB with proper synchronization.
The text was updated successfully, but these errors were encountered:
At the moment reporting jobs are executed by the ManagedExecutorService (MES) without any timeout, thus tasks may run forever.
Unlike other application servers' MES implementations, TomEE's MES does not have a "hung-task-threshold" config parameter.
How to detect hung tasks?
A scheduled method could check the "jobs" table for BUSY jobs with "jobdate" before some date. These jobs can be either in the MES's queue or are currently executed.
How to stop tasks?
MES does not offer any access methods to get the queue list or the current tasks in execution. The only way to manipulate tasks from outside is via the Future returned by the submit method of the MES. Futures offer a cancel() method.
Thus, a possible implementation could be to cache the submitted Futures (association with the Job via a Map<Future,Job>, hoping that TomEE's Future implementation has a proper equals()/hashCode() ...). This has to be done in a Singleton-EJB with proper synchronization.
The text was updated successfully, but these errors were encountered: