From 3a1ee79ee4239213b35f6b73a65c127c2af977fb Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Tue, 27 Oct 2009 02:36:57 -0700 Subject: Finally hunted down the Parallel deadlock. Packets were being handled asynchronously (filling up the threadpool with handlers), which would turn around and try to do parallel operations on the starved threadpool. The solution for now is to disable Parallel.cs operations until we can gracefully handle parallel operations with a potentially starved threadpool --- OpenSim/Region/Framework/Scenes/Scene.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 6c34056..42051d0 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -120,7 +120,7 @@ namespace OpenSim.Region.Framework.Scenes private readonly Timer m_restartTimer = new Timer(15000); // Wait before firing private int m_incrementsof15seconds; private volatile bool m_backingup; - private bool m_useAsyncWhenPossible = true; + private bool m_useAsyncWhenPossible; private Dictionary m_returns = new Dictionary(); private Dictionary m_groupsWithTargets = new Dictionary(); @@ -480,7 +480,7 @@ namespace OpenSim.Region.Framework.Scenes IConfig startupConfig = m_config.Configs["Startup"]; // Should we try to run loops synchronously or asynchronously? - m_useAsyncWhenPossible = startupConfig.GetBoolean("use_async_when_possible", true); + m_useAsyncWhenPossible = startupConfig.GetBoolean("use_async_when_possible", false); //Animation states m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); @@ -4261,10 +4261,13 @@ namespace OpenSim.Region.Framework.Scenes public void ForEachClient(Action action, bool doAsynchronous) { - if (doAsynchronous) - m_clientManager.ForEach(action); - else - m_clientManager.ForEachSync(action); + // FIXME: Asynchronous iteration is disabled until we have a threading model that + // can support calling this function from an async packet handler without + // potentially deadlocking + //if (doAsynchronous) + // m_clientManager.ForEach(action); + //else + // m_clientManager.ForEachSync(action); } public bool TryGetClient(UUID avatarID, out IClientAPI client) -- cgit v1.1