aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-11-04 20:23:18 +0000
committerJustin Clarke Casey2008-11-04 20:23:18 +0000
commit97d320d7d122a5720770c77f91793ace1229a5ab (patch)
treede64ab501113d33040ec7b74f9a8d51e5e724c29 /OpenSim
parent* Improve the previous fix by pushing the exception catching down into OGS1 g... (diff)
downloadopensim-SC_OLD-97d320d7d122a5720770c77f91793ace1229a5ab.zip
opensim-SC_OLD-97d320d7d122a5720770c77f91793ace1229a5ab.tar.gz
opensim-SC_OLD-97d320d7d122a5720770c77f91793ace1229a5ab.tar.bz2
opensim-SC_OLD-97d320d7d122a5720770c77f91793ace1229a5ab.tar.xz
* 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.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs48
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs4
2 files changed, 30 insertions, 22 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs
index b6c36f8..b277626 100644
--- a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs
@@ -390,32 +390,40 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
390 /// </summary> 390 /// </summary>
391 public void process() 391 public void process()
392 { 392 {
393 while (true) 393 try
394 { 394 {
395 MapRequestState st = requests.Dequeue(); 395 while (true)
396
397 // end gracefully
398 if (st.agentID == UUID.Zero)
399 {
400 ThreadTracker.Remove(mapItemReqThread);
401 break;
402 }
403
404 bool dorequest = true;
405 lock (m_rootAgents)
406 { 396 {
407 if (!m_rootAgents.Contains(st.agentID)) 397 MapRequestState st = requests.Dequeue();
408 dorequest = false; 398
409 } 399 // end gracefully
400 if (st.agentID == UUID.Zero)
401 {
402 ThreadTracker.Remove(mapItemReqThread);
403 break;
404 }
405
406 bool dorequest = true;
407 lock (m_rootAgents)
408 {
409 if (!m_rootAgents.Contains(st.agentID))
410 dorequest = false;
411 }
410 412
411 if (dorequest) 413 if (dorequest)
412 { 414 {
413 LLSDMap response = RequestMapItemsAsync("", st.agentID, st.flags, st.EstateID, st.godlike, st.itemtype, st.regionhandle); 415 LLSDMap response = RequestMapItemsAsync("", st.agentID, st.flags, st.EstateID, st.godlike, st.itemtype, st.regionhandle);
414 RequestMapItemsCompleted(response); 416 RequestMapItemsCompleted(response);
417 }
415 } 418 }
416 } 419 }
420 catch (Exception e)
421 {
422 m_log.ErrorFormat("[WorldMap]: Map item request thread terminated abnormally with exception {0}", e);
423 }
424
417 threadrunning = false; 425 threadrunning = false;
418 m_log.Warn("[WorldMap]: Remote request thread exiting"); 426 m_log.Debug("[WorldMap]: Remote request thread exiting");
419 } 427 }
420 428
421 /// <summary> 429 /// <summary>
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs
index 3adaf36..b520cde 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs
@@ -17,7 +17,7 @@
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARThY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
@@ -203,7 +203,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
203 catch (Exception e) 203 catch (Exception e)
204 { 204 {
205 if (lastScriptEngine != null) 205 if (lastScriptEngine != null)
206 lastScriptEngine.Log.WarnFormat("[{0}]: Exception {1} thrown", ScriptEngineName, e.GetType().ToString()); 206 lastScriptEngine.Log.ErrorFormat("[{0}]: Exception {1} thrown", ScriptEngineName, e.GetType().ToString());
207 throw e; 207 throw e;
208 } 208 }
209 } 209 }