Steven Erat's Blog Steven Erat Photography
 
 
Viewing By Entry
 
 

TalkingTree  ColdFusion MX Mail Spooler Behavior Might Cause SpoolLockTimeoutException

 

The mail spooler for ColdFusion MX 6.x/7 locks the mail spool directory when writing mail to disk. If a mail thread is trying to write a mail file to disk and is waiting to obtain the lock, it will wait up to 30 seconds and then throw a coldfusion.mail.MailSpooler$SpoolLockTimeoutException or coldfusion.mail.MailSessionException. I'm still exploring what might require the lock for so long and prevent other mail from being spooled to disk, but so far it seems well correlated with having message bodies of 12-15 MB in one case. The 30 second wait for the lock is hard coded and immutable, but writing a large message to disk shouldn't take 30 seconds in most situations. I'll update this later if I find more.

StackTrace coldfusion.mail.MailSessionException: An exception occurred when setting up mail server parameters
at coldfusion.mail.MailSpooler.storeMail(MailSpooler.java:670)
at coldfusion.tagext.net.MailTag.doAfterBody(MailTag.java:618)

"Error","scheduler-1","06/08/05","09:03:24",,"A problem occurred when attempting to deliver mail. This exception was caused by: coldfusion.mail.MailSpooler$SpoolLockTimeoutException: A timeout occurred while waiting for the lock on the mail spool directory.."

 


Comments

Steven,

I've seen this error occur recently for me as well. In my case, it appears that the error was being generated by an e-mail that was trying to attach a file that no longer existed.

Are you trying to attach a large document to your cfmail files? Maybe the the attachments aren't being created before being sent...

-Dan


Thanks for the tip. I'll check out that angle.


Hi Steven,

I am seeing this error to. In our case we are generating an html email report to a customer and it is over 12 MB in size.

Once the email spool and undelivr folder is cleared out, the lock on the Mail Spool still exists and is causing the error to appear in the logs every two minutes.

Any idea on how to release this lock w/o restarting ColdFusion?


Steven,

Any update on this problem? This is becoming a regular headache for us.

-Dan


we recived this same error when sending mass emails (6k). It seems that if a few of the emails are bad then coldfusion will hang and the mail spool locks up. The only way to fix this that I know of is by restarting coldfusion.

I will try a simple "try and catch" to see if that willl help prevent the problem.
Any other thoughts?


Im suddenly getting this error on a mail server that is an exact copy version-wise of a server that works without a problem. If anyone has a fix for this, I would really appreciate it.


I'm getting this error when sending large dumps trapped by a cferror. The worse part about it, is that CF never releases the lock and no further email goes out until I restart the service.


Rob,

while it is still not recommended to use the ServiceFactory (unless done carefully), perhaps this might be one exception to the rule where ServiceFactory methods might be helpful.

The ColdFusion MX 7 AdminAPI offers a support mechanism to programmatically adjust the Mail Service, but it does not expose the restart() method. You can get to the MailSpoolService.restart() method via the ServiceFactory.

What do you think of this code and does it have an effect on the problem:

<cflock type="EXCLUSIVE" name="MailSpoolServiceLock" timeout="10" throwontimeout="No">
<cfobject action="CREATE"
   type="JAVA"
   class="coldfusion.server.ServiceFactory"
   name="factory">
      
<cfset MailSpoolService = factory.getMailSpoolService()>
<cfset MailSpoolService.restart()>
</cflock>


I got that error without having an attachment to the email. I guess something before this caused the problem. Can the a non-email issue cause this problem? That for the solution.


cfmx 7.0.2 enterprise


I get this problem the same way that Rob Gonda does. cfdumps in an email from cferror.
I think its usually when a search engine hits and hits and hits on an error and basically floods the spooler.

I tried the MailSpoolerService code - I even added a quick link to the hotfix extension do run the restart from within cfadmin, but, unfortunately, it looks like the service is well and truely dead, so the restart() doesn't fail, but doesn't work either. Even a stop()/start() doesn't do anything.


I think I also got this problem the same way that Rob Gonda does. cfdumps in an email from cferror. I also tried the MailSpoolerService Code Like Seephen Moretti..with the same result..so I changed the Mail Spool Settings from disk to memory, increased Spool Interval (seconds) and Mail Delivery Threads. I restarted the CF server.. and all the mail is functioning correctly again ..changed the Mail Spool Settings back to disk.. so far so good. I will be monitoring the mail more carefully and see if this happens again.


Steven,

Was there any permanent solution to this issue. We are now encountering it with CF 7.02 (latest).

Sami


ColdFusion 8 has increased the timeout from 30 to 60 seconds. In addition we added a System property to control the timeout: coldfusion.spooltimeout. To use it, add the following to the JVM arguments (runtime/bin/jvm.config for standalone): -Dcoldfusion.spooltimeout=120 to increase to a 120 seconds timeout on the spool directory.

This lock is an internal lock and generally should only be locked for milliseconds. There is no actual locking on the directory or spool files. Switching to "spool to memory" will avoid this lock entirely (and increase performance). This would be a very good option if you are mailing 10-12mb worth of data.


There is a hotfix for CF 7.0.2 available here: http://kb.adobe.com/selfservice/viewContent.do?ext...


This also happens when you run out of disk space where the mailspool is at.


A new version of the MailSpooler technote should publish in the next few days. It is "Controlling the Mail Spool Timeout - Hot Fix for ColdFusion MX 7.0.2" - http://www.adobe.com/go/kb402001. It will clearly indicate that is was updated for April 2008 and the new hot fix is hf702-71489. It makes several updates to the MailSpool locking and should be installed by all mail users with 7.02.


Hi Steve,

I've had this happen in ColdFusion 8 too.

- Cass


Hi Cass,

Yes, I suppose its possible to see this issue in CF8. The default timeout for the spool lock was upped from 30 to 60 seconds in CF8, but you may need more. See TomJ's comment above about using the custom argument to set it higher with: -Dcoldfusion.spooltimeout


 

 

Calendar

 
Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    

Search This Site

 
This is an exact search only

About This Site

 
Adobe Alumni & Community Professional. Expert in ColdFusion, Flex, LCDS, Photoshop, Lightroom. Linux RHCE. Follow Me!. For my photography check out Boston Portrait Photographer.
More about me

Recent Entries

 
ColdFusion 9.01 Server Monito..

Recent Comments

 
Posted By Swagat:
Ben Forta, best-selling ColdFusion author is coming to India this August at India's largest Adobe Flash Platform Conference. Ben Forta will conduct a ...

Posted By Steve:
The updated presentation I gave at CF.Objective() 2010 is available here: [link] At the end of the preso I gave a brief, pre-recorded demo of wri ...

Posted By Brad Munz:
I've come across a OOM problem in HotSpot which looks alot like this: java.lang.OutOfMemoryError: requested 4096000 bytes for GrET in /BUILD_AREA/jdk6 ...

recently played

 

no song is playing

now playing, a plug-in for itunes

Categories

 
RSS Adobe (34)
RSS Bicycling (9)
RSS Blogging (39)
RSS Books (13)
RSS Breeze (13)
RSS CFMX Podcasts (10)
RSS ColdFusion (429)
RSS Computer Technology (51)
RSS Events (26)
RSS Flex (20)
RSS Gadgets (10)
RSS HiTech Industry (16)
RSS Java (25)
RSS Learning (57)
RSS Linux (70)
RSS Mac OS X (22)
RSS Macromedia (27)
RSS Meetup (35)
RSS New England (62)
RSS Odds & Ends (25)
RSS Outdoors (32)
RSS Personal (29)
RSS Photos (111)
RSS Photoshop (29)
RSS Podcasts (18)
RSS Rants (19)
RSS Restaurants (8)
RSS Science (34)
RSS Spain (16)
RSS Travel (42)
RSS Twitter (10)
RSS Video (20)
RSS Webcam (3)
RSS Writing (10)

Blogs I Read

 
Terrence Ryan
Ben Forta
Ray Camden
Kinky Solutions
Dan Vega
Gary Gilbert
Simeon Bateman
Red Hat Blogs
O'Reilly Digital Media
O'Reilly Radar
John Nack
The Strobist
Scott Kelby
Matt Kloskowski
Joe McNally
Digital Photography School
Engadget
Science Blog

RSS

 


Add to Google
Add to My Yahoo!

Aggregated By

 


Aggregated by ColdFusionBlogger.org

Credits and Stuff

 
BlogCFC - Free ColdFusion Powered Blog Software
CJM Group - ColdFusion Website Hosting


 
 
blog | photos | flickr | referers | webcam | stats | about | contact
 
Copyright © 2010 Steven Erat. All rights reserved.
This is a personal weblog. The opinions expressed here represent my own and not those of my employer