Add a stack trace to the error output on the recursive read lock warning on my RWlocks. Whilst recursive locks are safe, coupled with other issues we're experiencing with the TaskInventoryDictionary it implies that somewhere the lock is not being freed possibly due to a merge error somewhere, and thus it needs to be looked into.

avinationmerge
meta7 2010-08-10 09:07:17 -07:00
parent 7fead01786
commit 1ead2ed5ee
2 changed files with 128 additions and 104 deletions

View File

@ -30,6 +30,7 @@ using System.Collections.Generic;
using System.Threading; using System.Threading;
using System.Reflection; using System.Reflection;
using System.Xml; using System.Xml;
using System.Diagnostics;
using System.Xml.Schema; using System.Xml.Schema;
using System.Xml.Serialization; using System.Xml.Serialization;
using log4net; using log4net;
@ -90,6 +91,19 @@ namespace OpenSim.Framework
if (m_itemLock.RecursiveReadCount > 0) if (m_itemLock.RecursiveReadCount > 0)
{ {
m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue."); m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
try
{
StackTrace stackTrace = new StackTrace(); // get call stack
StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames)
// write call stack method names
foreach (StackFrame stackFrame in stackFrames)
{
m_log.Error("[SceneObjectGroup.m_parts] "+(stackFrame.GetMethod().Name); // write method name
}
}
catch
{}
m_itemLock.ExitReadLock(); m_itemLock.ExitReadLock();
} }
if (m_itemLock.RecursiveWriteCount > 0) if (m_itemLock.RecursiveWriteCount > 0)

View File

@ -29,6 +29,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Diagnostics;
using System.Threading; using System.Threading;
using System.Xml; using System.Xml;
using System.Xml.Serialization; using System.Xml.Serialization;
@ -138,6 +139,15 @@ namespace OpenSim.Region.Framework.Scenes
m_log.Error("[SceneObjectGroup.m_parts] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue."); m_log.Error("[SceneObjectGroup.m_parts] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
try try
{ {
StackTrace stackTrace = new StackTrace(); // get call stack
StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames)
// write call stack method names
foreach (StackFrame stackFrame in stackFrames)
{
m_log.Error("[SceneObjectGroup.m_parts] "+(stackFrame.GetMethod().Name); // write method name
}
m_partsLock.ExitReadLock(); m_partsLock.ExitReadLock();
} }
catch { } // Ignore errors, to allow resync catch { } // Ignore errors, to allow resync