diff options
author | Justin Clarke Casey | 2008-11-04 20:23:18 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-11-04 20:23:18 +0000 |
commit | 97d320d7d122a5720770c77f91793ace1229a5ab (patch) | |
tree | de64ab501113d33040ec7b74f9a8d51e5e724c29 /OpenSim/Region/Environment/Modules/World | |
parent | * Improve the previous fix by pushing the exception catching down into OGS1 g... (diff) | |
download | opensim-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 'OpenSim/Region/Environment/Modules/World')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs | 48 |
1 files changed, 28 insertions, 20 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> |