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

Tuesday, September 11, 2012

Free Microsoft Developer Training Kits (SharePoint)

SharePoint 2010 and Windows Phone 7 Training Kit
Provides developers with advanced guidance on how to develop Windows Phone 7 Applications for SharePoint.
Release Date:7/22/2011

SharePoint and Windows Azure Development Kit
The July 2011 release of the SharePoint and Azure Development Kit is a training course to help developers integrate SharePoint and Windows Azure.
Release Date:7/15/2011

Office 365 Developer Training Kit – June 2011 Update
Guidance that provides developers with advanced guidance on how to develop for Office 365 including SharePoint Online, Exchange Online and Lync Online
Release Date:6/28/2011

SharePoint and Silverlight Training Kit
Provides developers with advanced guidance on how to develop Silverlight Applications for SharePoint.
Release Date:4/7/2011

SharePoint 2010 Developer Training Kit
Guidance that provides developers with advanced guidance on how to develop for SharePoint.
Release Date:5/8/2010

Other Free Microsoft Developer Training Kits can be found here.

Thanks!