This morning, one of the endusers of my app contacted me and informed me
about an issue with the software i wrote to use @Singleton + @Lock(WRITE) +
@Schedule to retrieve emails from an email account where schedule = every 2
minutes.

This code has been running really well ever since I initially developed it
back in December 2012 after discussing this on the user list and getting
some tips from David Blevins, but this morning, the following exception,

Oct 29, 2013 1:30:00 AM
org.apache.openejb.core.timer.EjbTimerServiceImpl ejbTimeout
WARNING: RuntimeException from ejbTimeout on EmailRequestBean
javax.ejb.ConcurrentAccessTimeoutException: Unable to get write lock
on 'downloadEmailRequests' method for: utils.mail.EmailRequestBean
        at 
org.apache.openejb.core.singleton.SingletonContainer.aquireLock(SingletonContainer.java:298)
        at 
org.apache.openejb.core.singleton.SingletonContainer._invoke(SingletonContainer.java:217)
        at 
org.apache.openejb.core.singleton.SingletonContainer.invoke(SingletonContainer.java:197)
        at 
org.apache.openejb.core.timer.EjbTimerServiceImpl.ejbTimeout(EjbTimerServiceImpl.java:759)
        at 
org.apache.openejb.core.timer.EjbTimeoutJob.execute(EjbTimeoutJob.java:39)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:207)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)


was caused by one gmail-connection-timeout a little before 1:30am,

Oct 29, 2013 1:22:21 AM utils.mail.EmailHandler initialize
INFO: Exception caught:Connection timed out: connect
Oct 29, 2013 1:22:21 AM utils.mail.EmailRequestBean downloadEmailRequests
INFO: Error loading emails from Inbox; Connection timed out: connect

and then the ConcurrentAccessTimeoutException continued to occur until I
stopped tomee and (re)started tomee; please see log file[1]. I have already
made some tweaks to the software to 'prevent' or limit exceptions written
to the error log, when internet disconnection occurs. My app initiates
gmail IMAP and google-calendar API connections quite often via multiple
@Singleton + @Lock(WRITE) + @Schedule bean/methods.

Can someone advise on how best to recover from this 'domino-effect' type of
bug/issue? I know this is not a tomee bug, and i'm sure my app can recover
from this, just need a hint...please. thanks. :)


[1] https://gist.github.com/smithh032772/7215589

Reply via email to