Friday, September 14, 2012

Connection Execution Timeout ULS EventID fa45, fa46 tzku, fzkv, and btq8

The last couple days I have been investigating a long thread of event ID  fa45, fa46 tzku, fzkv, and btq8 in the ULS log.

These series of event were begin with EventID fa45, and then escalated to eventid fa46, tzku, fzkv and finally btq8. it was caused by connection execution timeout between SharePoint and SQL server... ULS looks like the example below:-

09/13/2012 14:35:35.37 w3wp.exe (0xF7FC) 0xEE04 SharePoint Foundation Database fa45 High System.Threading.ThreadAbortException: Thread was being aborted.
09/13/2012 14:35:35.39 w3wp.exe (0xF7FC) 0xEE04 SharePoint Foundation Database fa46 High at Microsoft.SharePoint.SPSqlClient.ExecuteQueryInternal(Boolean retryfordeadlock)....
09/13/2012 14:35:35.39 w3wp.exe (0xF7FC) 0xEE04 SharePoint Foundation Database tzku High ConnectionString: 'Data Source=sp2010db;Initial Catalog=WSS_Content;Integrated....
09/13/2012 14:35:35.40 w3wp.exe (0xF7FC) 0xEE04 SharePoint Foundation Database tzkv High SqlCommand: 'proc_EnumLists'     CommandType: StoredProcedure CommandTimeout: ....
09/13/2012 14:35:35.40 w3wp.exe (0xF7FC) 0xEE04 SharePoint Foundation Database btq8 High System.Threading.ThreadAbortException: Thread was being aborted.

This happened when there was a large query execution on a site (resource intensive query in a custom built webpart). Look closer into the code, I found recursive code that loop through the entire site and tried to fine a specific object in the site. The process took longer than the expected as a result of connection execution timeout error. The issue never appear before the migration, after the full migration, the objects on the site double, and require longer time to complete the query.

While this custom webpart does not execute frequently, so instead of rewrite the code, all I need to do is extending the connection timeout value between SharePoint and SQL Server. By default the connection timeout value is 120 seconds (2 minutes).  For my case, I increased the value to 300 seconds (5 minutes) and it solved my problem, and here is how.

Open the web.config file of the SharePoint site.
At the end of <httpHandlers/> Search for this blog of code (see below), and add the executionTimeout=”300” attribute to extend the timeout value

<httpHandlers />
<customErrors mode="On" />
<httpRuntime maxRequestLength="51200" executionTimeout="300" />
<authentication mode="Windows" />

Once the web.config is saved, the site will be reset… and these series of error should go away.

Please backup your web.config before making change. Good Luck!

Hope this help...Thanks!

Note:- Recursive function is not recommended for looping thru. the entire site, because it causes stack overflow when the stack reach it limited. the follow article in Code Project show you how to replace recursive function with while loop to avoid the stack-overflow

1 comment:

  1. Finding the time and actual effort to create a superb article like this is great thing. I’ll learn many new stuff right here! Good luck for the next post buddy..
    Sharepoint Training in Chennai

    ReplyDelete