EJBTimerService stop working

54 views Asked by At

I have a question about EJBTimerService.

EJBTimerService is central controller, which the use java.util.Timer.

java.util.Timer jdkTimer = ejbContainerUtil.getTimer();
jdkTimer.schedule(timerTask, timerExpiration);

My problem is java.util.Timer.mainLoop stop working and new task not scheduled.

After GlassFish source code analyzing I made conclusions. Problem happens because we receive RejectedExecutionException from ejbContainerUtil.addWork(work) when EJBTimeout.

EJBTimerTask timerTask = new EJBTimerTask(timerExpiration, timerId, this);
timerService_.taskExpired(timerId_);

Inside ejbContainerUtil.addWork we have defaultThreadPoolExecutor.submit()

defaultThreadPoolExecutor = EjbThreadPoolExecutor extends ThreadPoolExecutor + AbortPolicy.

TaskExpiredWork work = new TaskExpiredWork(this, timerId);
ejbContainerUtil.addWork(work);

So timer java.util.Timer.mainLoop stop working, because core poll is exceeded, queue is full, max core is exceeded, then we receive from ThreadPoolExecutor RejectedExecutionException.

I'm corret? Or I'm wrong?

0

There are 0 answers