* Practise some defensive programming - gracefully terminate the thread if there is a problm in the world map module rather than bringing down the whole server.

0.6.0-stable
Justin Clarke Casey 2008-11-04 20:23:18 +00:00
parent 21c0df53a2
commit 97d320d7d1
2 changed files with 30 additions and 22 deletions

View File

@ -389,6 +389,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
/// Processing thread main() loop for doing remote mapitem requests /// Processing thread main() loop for doing remote mapitem requests
/// </summary> /// </summary>
public void process() public void process()
{
try
{ {
while (true) while (true)
{ {
@ -414,8 +416,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
RequestMapItemsCompleted(response); RequestMapItemsCompleted(response);
} }
} }
}
catch (Exception e)
{
m_log.ErrorFormat("[WorldMap]: Map item request thread terminated abnormally with exception {0}", e);
}
threadrunning = false; threadrunning = false;
m_log.Warn("[WorldMap]: Remote request thread exiting"); m_log.Debug("[WorldMap]: Remote request thread exiting");
} }
/// <summary> /// <summary>

View File

@ -17,7 +17,7 @@
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARThY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
@ -203,7 +203,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
catch (Exception e) catch (Exception e)
{ {
if (lastScriptEngine != null) if (lastScriptEngine != null)
lastScriptEngine.Log.WarnFormat("[{0}]: Exception {1} thrown", ScriptEngineName, e.GetType().ToString()); lastScriptEngine.Log.ErrorFormat("[{0}]: Exception {1} thrown", ScriptEngineName, e.GetType().ToString());
throw e; throw e;
} }
} }