Possible deadlock detected while acquiring a readerlock
Posted on 16. Jan, 2010 by admin in Sharepoint
Slow performance happens on your sharepoint site and users start getting “Request timed out” errors, after couple minutes the slow behaviour disappears and the site is accessible again.
Error message in the ULS Logs:
Possible deadlock detected while acquiring a readerlock.
An unexpected error occurred while refreshing the shared object manager cache. Reason: This operation returned because the timeout period expired. (Exception from HRESULT: 0×800705B4) Techinal Details: System.ApplicationException: This operation returned because the timeout period expired. (Exception from HRESULT: 0×800705B4) at System.Threading.ReaderWriterLock.AcquireReaderLockInternal(Int32 millisecondsTimeout) at System.Threading.ReaderWriterLock.AcquireReaderLock(Int32 millisecondsTimeout) at Microsoft.SharePoint.Utilities.SPInitializeOnceLock..ctor(Boolean readerLock) at Microsoft.SharePoint.Utilities.SPInitializeOnceLock.AcquireReaderLock() at Microsoft.SharePoint.Administration.SPVolatileCache`2.GetValue(K key) at Microsoft.SharePoint.Administration.SPCac…
…he`2.get_Item(K key) at Microsoft.SharePoint.Administration.SPConfigurationDatabase.GetObject(Guid id, Boolean checkInMemoryCache) at Microsoft.SharePoint.Administration.SPConfigurationDatabase.GetObject(Guid id)
error in Event Viewer:
Source: Office SharePoint Server
Event ID: 7082
Description:
The description for Event ID 7082 from source Office SharePoint Server cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
This operation returned because the timeout period expired. (Exception from HRESULT: 0×800705B4)
System.ApplicationException: This operation returned because the timeout period expired. (Exception from HRESULT: 0×800705B4)
at System.Threading.ReaderWriterLock.AcquireReaderLockInternal(Int32 millisecondsTimeout)
at System.Threading.ReaderWriterLock.AcquireReaderLock(Int32 millisecondsTimeout)
at Microsoft.SharePoint.Utilities.SPInitializeOnceLock..ctor(Boolean readerLock)
at Microsoft.SharePoint.Utilities.SPInitializeOnceLock.AcquireReaderLock()
at Microsoft.SharePoint.Administration.SPVolatileCache`2.GetValue(K key)
at Microsoft.SharePoint.Administration.SPCache`2.get_Item(K key)
at Microsoft.SharePoint.Administration.SPConfigurationDatabase.GetObject(Guid id, Boolean checkInMemoryCache)
at Microsoft.SharePoint.Administration.SPConfigurationDatabase.GetObject(Guid id)
at Microsoft.SharePoint.Administration.SPFarm.GetObject(Guid id)
at Microsoft.Office.Server.Administration.SharedResourceProviderStoreDependency.get_IsValid()
at Microsoft.Office.Server.Administration.SharedObjectManager.Refresh()
you find errors of type System.Web.HttpException and System.ApplicationException
Resolution:
From the above logs, it seems there is deadlock happening and 1 of the requests is not releasing the resource for other requests to continue, so in other words, they keep waiting till the resource is free and this will cause request timeouts.
To solve this issue you need to know know what exactly is holding the resource and taking Memory Dump in this case will be very helpfull to know what exactly is happening behind the scenes. in my case i reset the sharepoint config cache which seemed to make locks on the config database and issue is resolved .
To clear the config cache on the farm, follow these steps:
- Stop the OWSTIMER service on ALL of the MOSS servers in the farm.
- On the Index server, navigate to:
Server 2003 location: Drive:\Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config\GUID and delete all the XML files from the directory.
Server 2008 location: Drive:\ProgramData\Microsoft\SharePoint\Config\GUID and delete all the XML files from the directory. - Delete all the XML file in the directory. NOTE: ONLY THE XML FILES, NOT THE .INI FILE.
- Open the cache.ini with Notepad and reset the number to 1. Save and close the file.
- Start the OWSTIMER service on the Index server and wait for XML files to begin to reappear in the directory.
- After you see XML files appearing on the Index server, repeat steps 2, 3 & 4 on each query server, waiting for XML files to appear before moving to subsequent servers.
- After all of the query servers have all been cleared and new .xml files have been generated, proceed to the WFE and Application servers in the farm, following steps 2, 3, 4 and 5 for each remaining server.
