mail.MailSpooler SpoolLockTimeoutException - coldfusion

An exception occurred when setting up mail server parameters. This
exception was caused by:
coldfusion.mail.MailSpooler$SpoolLockTimeoutException: A timeout
occurred while waiting for the lock on the mail spool directory..
Recently i started to get this nasty exception in my mail.log file. Once this exception shows up, every mail that is sent from that coldfusion instance throws the same exception.
The only thing that seems to work is to restart the coldfusion server. After (usually) a day or two the same exception pops up again and we're back in the same situation.
I am aware of the hotfix to control the mailspool timeout but all it does is increase the timeout from 30 to 60 seconds. Since the mails are sent successfully until i get the exception, i don't think this is my solution.
Also i read the thread in the adobe forum where people have installed the hotfix, but still get the error.
I also tried a script to restart only the mailservice when this exception showed up, but this didn't work for me, as it didn't for others with this problem. This would also not be a concrete solution.
The mails that i send arre simple html mails.
The number of mails sent spreaded over a day is not more then 30.
I've sent mails from
the exact same coldfusion server many times before, but with
<cfmail>. This is the first time i'm sending them in cfscript. I
don't know if this has anything to do with it, but it's only since
i'm using the cfscript equivalent of <cfmail> that i started to get
this exception.
All related blog posts that i could find are all unanswered but also pretty old. I thought that someone might have a solution by now.
Thanks.
(using coldfusion 9.0.1 server on windows 2008 server)

We were also experiencing this mail spool lock issue. After the issue occurred a fourth time in 2 months, we started reviewing these forums and found no solution.
This made me think that perhaps the solution and problem are not really CF at all, so I went into the server's virus protection and excluded the CF mail spool directory so that the virus protection does not touch the spool directory at all. So far, we have not had the problem again.
So I am not sure that this is the permanent fix, but it has worked so far for us. No outside entities create emails within our systems, so the directory should be relatively safe but not having email-outs work is not an option.

this chain from talkingtree might give some light:
http://www.talkingtree.com/blog/index.cfm?mode=entry&entry=67FD4A34-50DA-0559-A042BCA588B4C15B
what they are saying is that it could be an issue with disk activity taking to long. you can increase the mail spool timeout with the jvm argument: -Dcoldfusion.spooltimeout=120
oh.... one more thing. if you're using cfmail to email dumps when an error occurrs, make sure to add 'format="text"' to the cfdump tags. some of the emails can get pretty big and might be causing the error.

Related

Creating a Socket Server using Coldfusion

I want to notify my iPhone app of updates using a socket server for real time updates and to prevent the need for polling. My server side language is Coldfusion, and after weeks of searching the web following threads of people attempting to do this the conclusion everyone has come up with is that Coldfusion doesn't support this. Firstly if anyone has any suggestions that no one else has provided as to what is the proper way to do this with Coldfusion then feel free to cut me short and please enlighten me. Anyhow, a solution occurred to me (in my sleep!) and before I invest my time doing this I wanted to ask if it is critically flawed for any reason.
There isn't anything in the adminstrator that supports this, and people rightly point out that you can't instantiate a server socket on the page since it will hang the page waiting for requests, and that then the server will then be destroyed when the page times out.
But what is wrong with the following solution, I create my AppServer.cfc component, which essentially wraps a java ServerSocket. Then to trigger it run this:
<CFSET APPLICATION.servercfm=new AppServer()>
<CFTHREAD timeout="2147483647">
<CFSET APPLICATION.servercfm.start()>
</CFTHREAD>
The server then remains indefinately on the APPLICATION scope, and the page returns instantly. The thread timeout is sets to 60 years, although I'm sure that I'll have more frequent server restarts!
I hope this question isn't flagged as opinionated, my question is: is there ANY means, by which we can provide a service through a socket using Coldfusion whether it be my solution or any suggested by the forum.
Thanks

Can an unavailable datasource take down a ColdFusion 9 server?

Is it possible that a database (connected to ColdFusion 9 via a datasource connection) being unavailable could cause ColdFusion to become unresponsive? (The database is used for a singular one-off lightly-trafficked app.)
Recently, maintenance on a connected Oracle database (oracle jdbc) has caused that database to be unavailable two different times. Coincidentally, at both these times, ColdFusion pages on our site became unavailable or terribly slow to load (static HTML pages seemed to load fine, for the most part). Restarting the ColdFusion application server service would fix the problem, but only for minutes. The first time, during a time the application server was responsive, we unchecked the "Maintain connections" checkbox. I'm not sure this had any effect, then shortly after the Oracle database came back online, and we didn't seem to have the problem any more.
The second time that database was offline, we experienced a very similar issue with our website - ColdFusion pages becoming reaaaally slow or unavailable altogether. During one of the times when I could access the CF administrator, I updated the datasource and checked "Disable connections". Then I stopped and restarted both the CF ODBC agent and ODBC server services. After that, the problem seemed to stop, but I don't know enough to know if this is causation or coincidence.
Anyone have insights on this?
Server setup: Windows Server 2003 SP2, ColdFusion 9, IIS 6
There are a number of ways to slow a database to a crawl if not stop it completely. If you have hackers for example attacking your database through Port 1433 with attempted logins several times a second that can slow it down and if they get in they can of course do whatever they want. When this happened to me I found a record of attacks in the Event logs; the solution is better network security intercepting such attacks and never letting them actually talk to the database. Or say if your site is vulnerable to SQL injection attacks hackers could be messing with your database that way too but network security wouldn't necessarily work in that case. It doesn't require hackers to degrade the performance of your database however, you could be having a problem with allocated disk space for transaction logs or indexes filling up, or heaven forbid an imminent hardware failure showing early symptoms. You're backing up your database often I hope, off the server. To answer your question yes ColdFusion can and will become unresponsive when pages are called that call the database, and will usually display error messages when the database finally times out and never sends the requested data to ColdFusion. You can protect against that to some extent with CFTRY tags around your queries that display clean and polite error messages instead of ColdFusion's ugly ones if the database fails to return data, at least your site continues to look professional that way. One project I worked used a shared SQL Server database that often got overloaded and slowed down terribly and there was nothing I could do about improving that situation. What I did to keep the site functioning was to maintain a DB backup in the form of a MS Access database (yeah it was inappropriate but it worked when SQL Server wouldn't) and anytime SQL Server failed I had the application set up to automatically use code that called the Access database instead.
These are some ideas for you to think about if you are continuing to have problems, I see nobody's even tried to answer your question in the last six months and that's kinda been my experience with the quality of assistance this site has offered me too. I hope my thoughts can be of some use to you.

Web Service worker process timeout (error occured on receive)

I have been struggling with this issue for literally weeks now, but seem to have found a resolution after trying every option on the net. However i'm still at a loss to explain it.
We have a web service with a method that performs a long running SQL query and takes roughly 7 minutes to complete. However, on intermittant runs we get the error;
"The underlying connection was closed: An unexpected error occurred on
a receive."
Now it turns out that in IIS7 it was the Process Model section on the application pool causing this. Even if we set the 'Ping Maximum Response Time' to something like 600 seconds (10 minutes) the error would still appear at random times... sometimes even after only 100 seconds or so.
The only way to stop this error from happening is to set the 'Ping Enabled' feature to false.
I am concerned that this might not be the best way to fix the issue... but the client needs it fixed so this will do for now. Can anyone shed any light on this? We have other sites using older versions of IIS and SQL that do not have this issue. It is only happening on a server running SQL 2008 R2 Express and IIS 7.5.
It is built on the .NET framework v2.0.
Thanks for any insight anyone could give.

ColdFusion mail sending capacity

I am currently working on a newsletter application which needs to sent around 20K mails in a single shot. I feel, ColdFusion mail sending capacity will not be suitable for this. I don’t have any metrics with me to prove this.
I searched around in web about this, I found there are lot of complains about this kind of bulk mail sending process using built in CFMAIL. Few of them are,
Java heap size error
IOException while sending message
Mail Spool Lock
Mail Spool Timeout
We are using Adobe ColdFusion 9 standard edition.
Is anyone worked like this requirement? Did you faced any issues? How did you fixed that? Is any other alternative ways are there instead of using regular cfmail tag?
We have a system sending out nearly 500k messages about 2 to 3 times per day. CF does not have a problem with it if you have adequate resources allocated - meaning decent drives and space, adequate heap space, and (especially) a well performing SMTP relay. In our case we set up a dedicated relay server that we could fine tune carefully.
CF Mail has not had significant issues since ColdFusion 7. CF 8 and CF 9 both perform well. There is a level at which I would suggest a different system to be sure - and other requirements might mean an SaaS would serve you better - but from a per performance standpoint 20k messages is fairly small and should not be a problem for an enterprise class server.
I think you may face issue if you are using Standard version, I am not sure but there is some thread limit (I guess it it is 10) for spool for standard version which will delay email. Let's say there are 10 threads for spool and every thread wait for 15 seconds for next run (can be adjust from CFIDE) still it will take around 8.333 hours to send out all emails.
We have been using ColdFusion as a webmail delivery system since version 6. We have mail groups with 20k recipients.
We experienced one issue with it back then, the spooler hung and started retransmitting the same mail over and over again, making recipients receive the mail multiple times.
I think this issue was resolved with version 7.
If I recall well there's a difference between coldfusion standard and enterprise. Enterprise versions has enhanced CFMAIL throughput. At least it used to be in previous versions.

Very Strange JSAPI Visualization Charts slow loading

I know similar question have been asked earlier. But I rather explain mine because I feel there is a larger issue at hand.
Well I am working in a ASP.NET MVC environment. I have a set of jQuery and scripts being initialized in the _Layout.js file. I have added the https://www.goolge.com/jsapi at the end of all the remaining jQuery references.
1. Now, lately, not always, but sometimes (which is frequent for the last 4 days actually)... I realized my Google charts were not loading or were loading extremely slowly.
I used fiddler, I used firebug etc, but the request stop and waits and waits and keeps waiting at the stage where browser calls "Sending request google...."
I assumed it was because of fiddler and firebug there was some delay, but it was not. So this is what I tried, whenever the problem occurs I immediately switched off all fiddlers and firebugs and opened Command prompt and did a ping www.google.com....surprisingly "Request Timed Out". I immediatly also opened browser and tried to open www.google.com at this moment... It searched and then suddenly redirected to google.co.in as I am located in India.
Now, did anybody face such similar problem recently? I hope this is temporary... or is there anything I am missing?