tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Crowther" <>
Subject RE: Tomcat restart needed
Date Tue, 01 Aug 2006 14:43:41 GMT
> From: [] 
> In my web application, I have a thread running in the background that 
> sends emails to the user when some event occurs.
> However, yesterday it stopped sending emails.
> My question is: why did this happen, why was necessary to 
> restart tomcat to get things right?

Any of a myriad reasons, but my first guess (until shown otherwise)
would be your threading code.  Writing threaded code so that it handles
unusual conditions properly is *hard*.

For example, are you *absolutely* sure that your code has *no* race
conditions that would cause syncronisation between the email thread and
any worker threads to be lost?  Even if (say) two worker threads tried
to submit jobs to the email thread at the same time?  Did you take a
thread dump before you restarted Tomcat to analyse for possible
deadlocks?  Are you running on a multi-core or hyperthreaded processor,
where 'at the same time' takes on new meaning if you're used to a single

		- Peter

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message