Print Page | Close Window

Exception occurred during TDeliverQuarantineThread

Printed From: LogSat Software
Category: Spam Filter ISP
Forum Name: Spam Filter ISP Support
Forum Description: General support for Spam Filter ISP
URL: https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=6238
Printed Date: 27 December 2024 at 12:08pm


Topic: Exception occurred during TDeliverQuarantineThread
Posted By: jerbo128
Subject: Exception occurred during TDeliverQuarantineThread
Date Posted: 15 September 2007 at 9:55pm
Getting this error a lot:
 -- (5336) Exception occurred during TDeliverQuarantineThread.Execute: Timeout expired 1 2 3 4 5 6 7 36 37 38
 
I increased the SQL timeout from 1 to 3, but did not seem to make a difference.
 
Running SFE 713.  MSSQL is on the same machine as SFE.
 
Any idea's?



Replies:
Posted By: LogSat
Date Posted: 16 September 2007 at 7:37pm
The "DeliverQuarantineThread" is a query that executes every 5 seconds to see if there are any emails in the quarantine marked for delivery. These would be the emails that users force-deliver to themselves via the web interface. As most of the times the query will not return any records, and if it times-out it will be re-executed after 5 seconds, we have a very short timeout on it as to minimize resources. Dozens or may be a hundred or so of these per day should not be a big issue.

-------------
Roberto Franceschetti

http://www.logsat.com" rel="nofollow - LogSat Software

http://www.logsat.com/sfi-spam-filter.asp" rel="nofollow - Spam Filter ISP


Posted By: peet
Date Posted: 03 June 2010 at 8:00pm
I'm receiving these messages roughly every few seconds:

Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38

Any chance of some fine-tuning controls or tips on improving something to avoid these?


Posted By: peet
Date Posted: 04 June 2010 at 1:28pm
This issue is still happening.
The odd part is, it filters out and quarantines e-mails just fine.
I have a job on SQL to delete old e-mails, so I don't use that feature of the filter.
Basically people mark e-mails to be delivered, and they either never get it, or it gets to them a day later roughly. So it is a major issue for me right now.
On the SQL server I've change query timeout to 900 sec, but it had no effect.
I also checked in "Boost SQL Server Priority on Windowds" but it also hasn't made any difference. I seem to be experiencing this issue since I started using the AuthorizedToEmails.
Here is the frequency with time stamps.

06/04/10 10:19:46:718 -- (1780) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:19:51:828 -- (2408) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:19:56:906 -- (3220) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:20:01:015 -- (1552) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:20:06:078 -- (3276) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:20:11:093 -- (2768) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:20:16:203 -- (2504) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:20:21:203 -- (2172) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:20:26:250 -- (824) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:20:31:312 -- (3660) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:20:36:328 -- (3544) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:20:41:406 -- (3936) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:20:46:562 -- (1284) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:20:51:640 -- (4008) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:20:56:703 -- (1136) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:21:01:796 -- (2164) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:21:06:953 -- (1812) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:21:11:062 -- (3232) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:21:16:125 -- (2972) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:21:21:281 -- (2500) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:21:26:453 -- (1864) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:21:31:515 -- (2976) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:21:36:718 -- (2208) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:21:41:812 -- (180) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38
06/04/10 10:21:46:828 -- (3684) Exception occurred during TDeliverQuarantineThread.Execute: [Microsoft][ODBC SQL Server Driver]Timeout expired 1 2 3 4 5 6 7 36 37 38



Posted By: LogSat
Date Posted: 05 June 2010 at 5:08am
Peet,

The query that is timing out, based on the error in your log, is:

SELECT tblQuarantine.QuarID, tblQuarantine.EmailTo, tblQuarantine.EmailFrom, tblQuarantine.Deliver, tblQuarantine.Expire, tblMsgs.MsgID, tblMsgs.Msg
FROM tblQuarantine INNER JOIN tblMsgs ON tblQuarantine.MsgID = tblMsgs.MsgID
WHERE Deliver <> 0 AND Expire = 0 AND
( (ServerID = nnn) OR (ServerID = 0) OR (ServerID IS NULL) )

The "nnn" value from above is the value of the "tblServersServerID=" parameter in your SpamFilter.ini file.  This value defaults to one. Can you please substitute the "nnn" with that value, and try to execute that query on your SpamFilter database? The query should normally take no more that a few tenths of a second to run. Can you please let us know how long it takes to complete when executed manually?

SpamFilter does have a 5 second timeout when running that query, and this can be increased by changing the parameter:

MiscSQLTimeout=5

in the SpamFilter.ini file (there is no need to restart SpamFilter after making the change). Please note that while this may solve the immediate issue, that indicates a bigger database problem as this query should not take that long to execute.



-------------
Roberto Franceschetti

http://www.logsat.com" rel="nofollow - LogSat Software

http://www.logsat.com/sfi-spam-filter.asp" rel="nofollow - Spam Filter ISP


Posted By: peet
Date Posted: 09 June 2010 at 6:56pm
That SQL query seems to work well in my SQL server's query window.
It didn't tell me how long the process took, but it was fairly quick.
I've cut down on my quarantine data recently from over 3 million records to 1.2 million records.
But I'm still seeing this error message.

The QuarID currently is: 25439246 for a new message.
I wonder if there is a limit at which this could cause an issue.


Posted By: peet
Date Posted: 09 June 2010 at 6:58pm
Odd.. my my ini file: MiscSQLTimeout was equal to 1/
Could that be part of the problem?

I'm changing it to 5, and will see what happens.


Posted By: peet
Date Posted: 09 June 2010 at 7:01pm
Well, for a quick test, I'm not seeing this message. I am clueless why it would have been set to "1".
Any chance that a previous install version had it at "1"?
I don't recall ever changing that in the ini file.


Posted By: LogSat
Date Posted: 10 June 2010 at 1:22pm
We did a bit of research, and have indeed found inconsistencies in some of the initial SpamFilter.ini files that were shipped in the various versions, as in some cases the default was 1 second and in others 5 seconds.
Please do note that this query checks for items to be delivered, is executed every 5 seconds, and normally should take only a few tenths of a second to execute. There can be *occasionally* a timeout (even if the timeout in the ini file is set to 1 second), but it is usually not a concern as the query is re-executed after 5 seconds. If in your case the timeouts were consistently occurring (meaning the query is taking over a second every single time), and you eliminated them by increasing the timeout to 5 seconds, that still does possibly indicate lingering performance issues on the database.
Have you tried using the SQL Server's client statistics (from the SQL Server Management Studio menu:  Query - Include Client Statistics) to time that query more in detail?


-------------
Roberto Franceschetti

http://www.logsat.com" rel="nofollow - LogSat Software

http://www.logsat.com/sfi-spam-filter.asp" rel="nofollow - Spam Filter ISP


Posted By: peet
Date Posted: 10 June 2010 at 2:42pm
Thanks, I was not aware the statistics option. I am using an older version of SQL, so it isn't the studio, but I found the statistics.
Running the same query resulted with:

Time Statistics
 
Cumulative client processing time 12 12   
Cumulative wait time on server replies 0 0

I'm assuming that is 12 milliseconds? visually I had the results in about a second.

On the other hand, now that I don't see the error messages, looks like there is nothing to deliver usually. Also since I've cut the amount of data on the server, it has less records to look through. I'm now down from the usual 3.6million records to around 1 million records.

I'll do a defrag of the database this weekend to shrink the db file.
Thanks for the help, looks like it solved it!


Posted By: LogSat
Date Posted: 10 June 2010 at 4:04pm
Most of the times the query will return no rows, as emails marked for delivery form the quarantine will usually be tagged as such only sporadically.
In regards to the statistics, there *should* be one called "Total execution time" which is usually the one you'll want to look at. If that's not there, the sum of the "client processing time" and of the "server processing time" should give you the total time used.


-------------
Roberto Franceschetti

http://www.logsat.com" rel="nofollow - LogSat Software

http://www.logsat.com/sfi-spam-filter.asp" rel="nofollow - Spam Filter ISP



Print Page | Close Window