aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Monitoring/Watchdog.cs24
-rw-r--r--OpenSim/Framework/Monitoring/WorkManager.cs1
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs11
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs4
-rw-r--r--OpenSim/Framework/Util.cs11
-rw-r--r--OpenSim/Region/Application/Application.cs2
-rw-r--r--OpenSim/Region/Application/OpenSim.cs9
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs13
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs15
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs52
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs5
-rwxr-xr-xOpenSim/Region/ScriptEngine/XEngine/XEngine.cs1
-rw-r--r--OpenSim/Server/Base/ServicesServerBase.cs4
-rw-r--r--OpenSim/Server/ServerMain.cs6
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs12
-rw-r--r--OpenSim/Services/Interfaces/IGridService.cs40
17 files changed, 124 insertions, 88 deletions
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs
index 9cc61ee..8a4894e 100644
--- a/OpenSim/Framework/Monitoring/Watchdog.cs
+++ b/OpenSim/Framework/Monitoring/Watchdog.cs
@@ -180,6 +180,30 @@ namespace OpenSim.Framework.Monitoring
180 m_watchdogTimer.Elapsed += WatchdogTimerElapsed; 180 m_watchdogTimer.Elapsed += WatchdogTimerElapsed;
181 } 181 }
182 182
183 public static void Stop()
184 {
185 if(m_threads == null)
186 return;
187
188 lock(m_threads)
189 {
190 m_enabled = false;
191 if(m_watchdogTimer != null)
192 {
193 m_watchdogTimer.Dispose();
194 m_watchdogTimer = null;
195 }
196
197 foreach(ThreadWatchdogInfo twi in m_threads.Values)
198 {
199 Thread t = twi.Thread;
200 if(t.IsAlive)
201 t.Abort();
202 }
203 m_threads.Clear();
204 }
205 }
206
183 /// <summary> 207 /// <summary>
184 /// Add a thread to the watchdog tracker. 208 /// Add a thread to the watchdog tracker.
185 /// </summary> 209 /// </summary>
diff --git a/OpenSim/Framework/Monitoring/WorkManager.cs b/OpenSim/Framework/Monitoring/WorkManager.cs
index a3e0390..9d52f71 100644
--- a/OpenSim/Framework/Monitoring/WorkManager.cs
+++ b/OpenSim/Framework/Monitoring/WorkManager.cs
@@ -85,6 +85,7 @@ namespace OpenSim.Framework.Monitoring
85 public static void Stop() 85 public static void Stop()
86 { 86 {
87 JobEngine.Stop(); 87 JobEngine.Stop();
88 Watchdog.Stop();
88 } 89 }
89 90
90 /// <summary> 91 /// <summary>
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 2834d94..f832f81 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -136,20 +136,21 @@ namespace OpenSim.Framework.Servers
136 136
137 protected override void ShutdownSpecific() 137 protected override void ShutdownSpecific()
138 { 138 {
139 139 Watchdog.Enabled = false;
140
141 base.ShutdownSpecific(); 140 base.ShutdownSpecific();
142 141
143 MainServer.Stop(); 142 MainServer.Stop();
144 143
145 Thread.Sleep(5000); 144 Thread.Sleep(5000);
146 145 Util.StopThreadPool();
147 WorkManager.Stop(); 146 WorkManager.Stop();
148 147
148 Thread.Sleep(1000);
149 RemovePIDFile(); 149 RemovePIDFile();
150
150 m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting..."); 151 m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting...");
151 152
152 if (!SuppressExit) 153 if (!SuppressExit)
153 Environment.Exit(0); 154 Environment.Exit(0);
154 } 155 }
155 156
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
index 94a9490..ffc6ad3 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
@@ -91,7 +91,7 @@ namespace OpenSim.Framework.Servers.HttpServer
91 PoolWorkerJob, 91 PoolWorkerJob,
92 string.Format("PollServiceWorkerThread {0}:{1}", i, m_server.Port), 92 string.Format("PollServiceWorkerThread {0}:{1}", i, m_server.Port),
93 ThreadPriority.Normal, 93 ThreadPriority.Normal,
94 false, 94 true,
95 false, 95 false,
96 null, 96 null,
97 int.MaxValue); 97 int.MaxValue);
@@ -101,7 +101,7 @@ namespace OpenSim.Framework.Servers.HttpServer
101 this.CheckRetries, 101 this.CheckRetries,
102 string.Format("PollServiceWatcherThread:{0}", m_server.Port), 102 string.Format("PollServiceWatcherThread:{0}", m_server.Port),
103 ThreadPriority.Normal, 103 ThreadPriority.Normal,
104 false, 104 true,
105 true, 105 true,
106 null, 106 null,
107 1000 * 60 * 10); 107 1000 * 60 * 10);
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index f6ded04..5eedd29 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -2579,7 +2579,6 @@ namespace OpenSim.Framework
2579 } 2579 }
2580 catch (ThreadAbortException e) 2580 catch (ThreadAbortException e)
2581 { 2581 {
2582 m_log.Error(string.Format("Aborted threadfunc {0} ", threadFuncNum), e);
2583 } 2582 }
2584 catch (Exception e) 2583 catch (Exception e)
2585 { 2584 {
@@ -2852,6 +2851,16 @@ namespace OpenSim.Framework
2852 return stpi; 2851 return stpi;
2853 } 2852 }
2854 2853
2854 public static void StopThreadPool()
2855 {
2856 if (m_ThreadPool == null)
2857 return;
2858 SmartThreadPool pool = m_ThreadPool;
2859 m_ThreadPool = null;
2860
2861 try { pool.Shutdown(); } catch {}
2862 }
2863
2855 #endregion FireAndForget Threading Pattern 2864 #endregion FireAndForget Threading Pattern
2856 2865
2857 /// <summary> 2866 /// <summary>
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index 4bd2c28..447afb4 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -79,7 +79,7 @@ namespace OpenSim
79 else 79 else
80 { 80 {
81 ServicePointManager.DefaultConnectionLimit = 12; 81 ServicePointManager.DefaultConnectionLimit = 12;
82 try { ServicePointManager.DnsRefreshTimeout = 120000; } // just is case crazy some mono decides to have it infinity 82 try { ServicePointManager.DnsRefreshTimeout = 120000; } // just is case some crazy mono decides to have it infinity
83 catch { } 83 catch { }
84 } 84 }
85 85
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 524f2be..5977f40 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -143,7 +143,7 @@ namespace OpenSim
143 //Mono.Unix.Native.Signum signal = signals [index].Signum; 143 //Mono.Unix.Native.Signum signal = signals [index].Signum;
144 MainConsole.Instance.RunCommand("shutdown"); 144 MainConsole.Instance.RunCommand("shutdown");
145 } 145 }
146 }); 146 });
147#endif 147#endif
148 148
149 /// <summary> 149 /// <summary>
@@ -165,6 +165,7 @@ namespace OpenSim
165 { 165 {
166 new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGTERM) 166 new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGTERM)
167 }; 167 };
168 signal_thread.IsBackground = true;
168 signal_thread.Start(); 169 signal_thread.Start();
169 } 170 }
170 catch (Exception e) 171 catch (Exception e)
@@ -485,6 +486,12 @@ namespace OpenSim
485 RunCommandScript(m_shutdownCommandsFile); 486 RunCommandScript(m_shutdownCommandsFile);
486 } 487 }
487 488
489 if (m_timedScript != "disabled")
490 {
491 m_scriptTimer.Dispose();
492 m_timedScript = "disabled";
493 }
494
488 base.ShutdownSpecific(); 495 base.ShutdownSpecific();
489 } 496 }
490 497
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
index f733972..27db72c 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
@@ -88,8 +88,8 @@ namespace OpenSim.Region.ClientStack.Linden
88 private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>(); 88 private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>();
89 private static Thread[] m_workerThreads = null; 89 private static Thread[] m_workerThreads = null;
90 private static int m_NumberScenes = 0; 90 private static int m_NumberScenes = 0;
91 private static OpenMetaverse.BlockingQueue<aPollRequest> m_queue = 91 private static OpenSim.Framework.BlockingQueue<aPollRequest> m_queue =
92 new OpenMetaverse.BlockingQueue<aPollRequest>(); 92 new OpenSim.Framework.BlockingQueue<aPollRequest>();
93 93
94 private Dictionary<UUID, PollServiceMeshEventArgs> m_pollservices = new Dictionary<UUID, PollServiceMeshEventArgs>(); 94 private Dictionary<UUID, PollServiceMeshEventArgs> m_pollservices = new Dictionary<UUID, PollServiceMeshEventArgs>();
95 95
@@ -170,7 +170,7 @@ namespace OpenSim.Region.ClientStack.Linden
170 m_workerThreads[i] = WorkManager.StartThread(DoMeshRequests, 170 m_workerThreads[i] = WorkManager.StartThread(DoMeshRequests,
171 String.Format("GetMeshWorker{0}", i), 171 String.Format("GetMeshWorker{0}", i),
172 ThreadPriority.Normal, 172 ThreadPriority.Normal,
173 false, 173 true,
174 false, 174 false,
175 null, 175 null,
176 int.MaxValue); 176 int.MaxValue);
@@ -203,9 +203,12 @@ namespace OpenSim.Region.ClientStack.Linden
203 { 203 {
204 while(true) 204 while(true)
205 { 205 {
206 aPollRequest poolreq = m_queue.Dequeue(); 206 aPollRequest poolreq = m_queue.Dequeue(1000);
207 if(m_NumberScenes <= 0)
208 return;
207 Watchdog.UpdateThread(); 209 Watchdog.UpdateThread();
208 poolreq.thepoll.Process(poolreq); 210 if(poolreq.reqID != UUID.Zero)
211 poolreq.thepoll.Process(poolreq);
209 } 212 }
210 } 213 }
211 214
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
index c9f3b7e..d6b4873 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
@@ -77,8 +77,8 @@ namespace OpenSim.Region.ClientStack.Linden
77 private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>(); 77 private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>();
78 private static Thread[] m_workerThreads = null; 78 private static Thread[] m_workerThreads = null;
79 private static int m_NumberScenes = 0; 79 private static int m_NumberScenes = 0;
80 private static OpenMetaverse.BlockingQueue<aPollRequest> m_queue = 80 private static OpenSim.Framework.BlockingQueue<aPollRequest> m_queue =
81 new OpenMetaverse.BlockingQueue<aPollRequest>(); 81 new OpenSim.Framework.BlockingQueue<aPollRequest>();
82 82
83 private Dictionary<UUID,PollServiceTextureEventArgs> m_pollservices = new Dictionary<UUID,PollServiceTextureEventArgs>(); 83 private Dictionary<UUID,PollServiceTextureEventArgs> m_pollservices = new Dictionary<UUID,PollServiceTextureEventArgs>();
84 84
@@ -139,7 +139,7 @@ namespace OpenSim.Region.ClientStack.Linden
139 m_workerThreads[i] = WorkManager.StartThread(DoTextureRequests, 139 m_workerThreads[i] = WorkManager.StartThread(DoTextureRequests,
140 String.Format("GetTextureWorker{0}", i), 140 String.Format("GetTextureWorker{0}", i),
141 ThreadPriority.Normal, 141 ThreadPriority.Normal,
142 false, 142 true,
143 false, 143 false,
144 null, 144 null,
145 int.MaxValue); 145 int.MaxValue);
@@ -274,7 +274,7 @@ namespace OpenSim.Region.ClientStack.Linden
274 { 274 {
275 if (responses.Count > 0) 275 if (responses.Count > 0)
276 { 276 {
277 if (m_queue.Count >= 4) 277 if (m_queue.Count() >= 4)
278 { 278 {
279 // Never allow more than 4 fetches to wait 279 // Never allow more than 4 fetches to wait
280 reqinfo.send503 = true; 280 reqinfo.send503 = true;
@@ -445,9 +445,12 @@ namespace OpenSim.Region.ClientStack.Linden
445 { 445 {
446 while (true) 446 while (true)
447 { 447 {
448 aPollRequest poolreq = m_queue.Dequeue(); 448 aPollRequest poolreq = m_queue.Dequeue(2000);
449 if(m_NumberScenes <= 0)
450 return;
449 Watchdog.UpdateThread(); 451 Watchdog.UpdateThread();
450 poolreq.thepoll.Process(poolreq); 452 if(poolreq.reqID != UUID.Zero)
453 poolreq.thepoll.Process(poolreq);
451 } 454 }
452 } 455 }
453 456
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
index 1ea0454..422c354 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
@@ -206,7 +206,7 @@ namespace OpenSim.Region.ClientStack.Linden
206 m_workerThreads[i] = WorkManager.StartThread(DoInventoryRequests, 206 m_workerThreads[i] = WorkManager.StartThread(DoInventoryRequests,
207 String.Format("InventoryWorkerThread{0}", i), 207 String.Format("InventoryWorkerThread{0}", i),
208 ThreadPriority.Normal, 208 ThreadPriority.Normal,
209 false, 209 true,
210 true, 210 true,
211 null, 211 null,
212 int.MaxValue); 212 int.MaxValue);
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 4b846f5..ca20604 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -527,15 +527,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
527 { 527 {
528 string homeURI = Scene.GetAgentHomeURI(sp.ControllingClient.AgentId); 528 string homeURI = Scene.GetAgentHomeURI(sp.ControllingClient.AgentId);
529 529
530 string message; 530 string reason = String.Empty;
531 finalDestination = GetFinalDestination(reg, sp.ControllingClient.AgentId, homeURI, out message); 531 finalDestination = GetFinalDestination(reg, sp.ControllingClient.AgentId, homeURI, out reason);
532 532
533 if (finalDestination == null) 533 if (finalDestination == null)
534 { 534 {
535 m_log.WarnFormat( "{0} Final destination is having problems. Unable to teleport {1} {2}: {3}", 535 m_log.WarnFormat( "{0} Final destination is having problems. Unable to teleport {1} {2}: {3}",
536 LogHeader, sp.Name, sp.UUID, message); 536 LogHeader, sp.Name, sp.UUID, reason);
537 537
538 sp.ControllingClient.SendTeleportFailed(message); 538 sp.ControllingClient.SendTeleportFailed(reason);
539 return; 539 return;
540 } 540 }
541 541
@@ -548,17 +548,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
548 return; 548 return;
549 } 549 }
550 550
551 // Validate assorted conditions
552 string reason = string.Empty;
553 if (!ValidateGenericConditions(sp, reg, finalDestination, teleportFlags, out reason)) 551 if (!ValidateGenericConditions(sp, reg, finalDestination, teleportFlags, out reason))
554 { 552 {
555 sp.ControllingClient.SendTeleportFailed(reason); 553 sp.ControllingClient.SendTeleportFailed(reason);
556 return; 554 return;
557 } 555 }
558 556
559 if (message != null)
560 sp.ControllingClient.SendAgentAlertMessage(message, true);
561
562 // 557 //
563 // This is it 558 // This is it
564 // 559 //
@@ -735,8 +730,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
735 IPEndPoint endPoint = finalDestination.ExternalEndPoint; 730 IPEndPoint endPoint = finalDestination.ExternalEndPoint;
736 if (endPoint == null || endPoint.Address == null) 731 if (endPoint == null || endPoint.Address == null)
737 { 732 {
738 sp.ControllingClient.SendTeleportFailed("Remote Region appears to be down"); 733 sp.ControllingClient.SendTeleportFailed("Could not resolve destination Address");
739
740 return; 734 return;
741 } 735 }
742 736
@@ -784,22 +778,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
784 // At least on LL 3.3.4, this is not strictly necessary - a teleport will succeed without sending this to 778 // At least on LL 3.3.4, this is not strictly necessary - a teleport will succeed without sending this to
785 // the viewer. However, it might mean that the viewer does not see the black teleport screen (untested). 779 // the viewer. However, it might mean that the viewer does not see the black teleport screen (untested).
786 sp.ControllingClient.SendTeleportStart(teleportFlags); 780 sp.ControllingClient.SendTeleportStart(teleportFlags);
787 781
788 // the avatar.Close below will clear the child region list. We need this below for (possibly)
789 // closing the child agents, so save it here (we need a copy as it is Clear()-ed).
790 //List<ulong> childRegions = avatar.KnownRegionHandles;
791 // Compared to ScenePresence.CrossToNewRegion(), there's no obvious code to handle a teleport
792 // failure at this point (unlike a border crossing failure). So perhaps this can never fail
793 // once we reach here...
794 //avatar.Scene.RemoveCapsHandler(avatar.UUID);
795
796 AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); 782 AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
797 AgentCircuitData agentCircuit = sp.ControllingClient.RequestClientInfo(); 783 AgentCircuitData agentCircuit = sp.ControllingClient.RequestClientInfo();
798 agentCircuit.startpos = position; 784 agentCircuit.startpos = position;
799 agentCircuit.child = true; 785 agentCircuit.child = true;
800 786
801// agentCircuit.Appearance = sp.Appearance;
802// agentCircuit.Appearance = new AvatarAppearance(sp.Appearance, true, false);
803 agentCircuit.Appearance = new AvatarAppearance(); 787 agentCircuit.Appearance = new AvatarAppearance();
804 agentCircuit.Appearance.AvatarHeight = sp.Appearance.AvatarHeight; 788 agentCircuit.Appearance.AvatarHeight = sp.Appearance.AvatarHeight;
805 789
@@ -1673,6 +1657,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1673 return agent; 1657 return agent;
1674 } 1658 }
1675 1659
1660 IPEndPoint endpoint = neighbourRegion.ExternalEndPoint;
1661 if(endpoint == null)
1662 {
1663 m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: failed to resolve neighbour address {0} ",neighbourRegion.ExternalHostName);
1664 return agent;
1665 }
1666
1676 m_entityTransferStateMachine.SetInTransit(agent.UUID); 1667 m_entityTransferStateMachine.SetInTransit(agent.UUID);
1677 agent.RemoveFromPhysicalScene(); 1668 agent.RemoveFromPhysicalScene();
1678 1669
@@ -1683,7 +1674,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1683 return agent; 1674 return agent;
1684 } 1675 }
1685 1676
1686 CrossAgentToNewRegionPost(agent, pos, neighbourRegion, isFlying, ctx); 1677 CrossAgentToNewRegionPost(agent, pos, neighbourRegion, endpoint, isFlying, ctx);
1687 } 1678 }
1688 catch (Exception e) 1679 catch (Exception e)
1689 { 1680 {
@@ -1727,6 +1718,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1727 agent.AddNeighbourRegion(neighbourRegion, agentCircuit.CapsPath); 1718 agent.AddNeighbourRegion(neighbourRegion, agentCircuit.CapsPath);
1728 1719
1729 IPEndPoint endPoint = neighbourRegion.ExternalEndPoint; 1720 IPEndPoint endPoint = neighbourRegion.ExternalEndPoint;
1721 if(endPoint == null)
1722 {
1723 m_log.DebugFormat("CrossAgentCreateFarChild failed to resolve neighbour address {0}", neighbourRegion.ExternalHostName);
1724 return false;
1725 }
1730 if (Scene.SimulationService.CreateAgent(source, neighbourRegion, agentCircuit, (int)TeleportFlags.Default, ctx, out reason)) 1726 if (Scene.SimulationService.CreateAgent(source, neighbourRegion, agentCircuit, (int)TeleportFlags.Default, ctx, out reason))
1731 { 1727 {
1732 string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); 1728 string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
@@ -1821,7 +1817,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1821 } 1817 }
1822 1818
1823 public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, 1819 public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion,
1824 bool isFlying, EntityTransferContext ctx) 1820 IPEndPoint endpoint, bool isFlying, EntityTransferContext ctx)
1825 { 1821 {
1826 1822
1827 string agentcaps; 1823 string agentcaps;
@@ -1848,15 +1844,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1848 { 1844 {
1849 m_eqModule.CrossRegion( 1845 m_eqModule.CrossRegion(
1850 neighbourRegion.RegionHandle, pos, vel2 /* agent.Velocity */, 1846 neighbourRegion.RegionHandle, pos, vel2 /* agent.Velocity */,
1851 neighbourRegion.ExternalEndPoint, 1847 endpoint, capsPath, agent.UUID, agent.ControllingClient.SessionId,
1852 capsPath, agent.UUID, agent.ControllingClient.SessionId,
1853 neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY); 1848 neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY);
1854 } 1849 }
1855 else 1850 else
1856 { 1851 {
1857 m_log.ErrorFormat("{0} Using old CrossRegion packet. Varregion will not work!!", LogHeader); 1852 m_log.ErrorFormat("{0} Using old CrossRegion packet. Varregion will not work!!", LogHeader);
1858 agent.ControllingClient.CrossRegion(neighbourRegion.RegionHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, 1853 agent.ControllingClient.CrossRegion(neighbourRegion.RegionHandle, pos, agent.Velocity,
1859 capsPath); 1854 endpoint,capsPath);
1860 } 1855 }
1861 1856
1862 // SUCCESS! 1857 // SUCCESS!
@@ -1953,7 +1948,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1953 1948
1954 seeds.Add(regionhandler, agent.CapsPath); 1949 seeds.Add(regionhandler, agent.CapsPath);
1955 1950
1956
1957// agent.ChildrenCapSeeds = new Dictionary<ulong, string>(seeds); 1951// agent.ChildrenCapSeeds = new Dictionary<ulong, string>(seeds);
1958 agent.ChildrenCapSeeds = null; 1952 agent.ChildrenCapSeeds = null;
1959 1953
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
index eb6455a..1688aa6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
@@ -188,9 +188,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
188 cmdHandlerThreadCycleSleepms = 100; 188 cmdHandlerThreadCycleSleepms = 100;
189 } 189 }
190 190
191/*
191 ~AsyncCommandManager() 192 ~AsyncCommandManager()
192 { 193 {
193 // Shut down thread 194 // Shut down thread
195
194 try 196 try
195 { 197 {
196 lock (staticLock) 198 lock (staticLock)
@@ -213,7 +215,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
213 { 215 {
214 } 216 }
215 } 217 }
216 218*/
217 /// <summary> 219 /// <summary>
218 /// Main loop for the manager thread 220 /// Main loop for the manager thread
219 /// </summary> 221 /// </summary>
@@ -229,6 +231,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
229 231
230 Watchdog.UpdateThread(); 232 Watchdog.UpdateThread();
231 } 233 }
234 catch ( System.Threading.ThreadAbortException) { }
232 catch (Exception e) 235 catch (Exception e)
233 { 236 {
234 m_log.Error("[ASYNC COMMAND MANAGER]: Exception in command handler pass: ", e); 237 m_log.Error("[ASYNC COMMAND MANAGER]: Exception in command handler pass: ", e);
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 2e39033..c1abba2 100755
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1079,6 +1079,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1079 "[XEngine]: Started {0} scripts in {1}", scriptsStarted, m_Scene.Name); 1079 "[XEngine]: Started {0} scripts in {1}", scriptsStarted, m_Scene.Name);
1080 } 1080 }
1081 } 1081 }
1082 catch (System.Threading.ThreadAbortException) { }
1082 catch (Exception e) 1083 catch (Exception e)
1083 { 1084 {
1084 m_log.Error( 1085 m_log.Error(
diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs
index 4951776..176e876 100644
--- a/OpenSim/Server/Base/ServicesServerBase.cs
+++ b/OpenSim/Server/Base/ServicesServerBase.cs
@@ -211,6 +211,7 @@ namespace OpenSim.Server.Base
211 { 211 {
212 new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGTERM) 212 new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGTERM)
213 }; 213 };
214 ignal_thread.IsBackground = true;
214 signal_thread.Start(); 215 signal_thread.Start();
215 } 216 }
216 catch (Exception e) 217 catch (Exception e)
@@ -249,6 +250,9 @@ namespace OpenSim.Server.Base
249 } 250 }
250 } 251 }
251 252
253 MemoryWatchdog.Enabled = false;
254 Watchdog.Enabled = false;
255 WorkManager.Stop();
252 RemovePIDFile(); 256 RemovePIDFile();
253 257
254 return 0; 258 return 0;
diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs
index a331b39..5c99ab7 100644
--- a/OpenSim/Server/ServerMain.cs
+++ b/OpenSim/Server/ServerMain.cs
@@ -33,6 +33,7 @@ using System.Net;
33using System.Net.Security; 33using System.Net.Security;
34using System.Security.Cryptography.X509Certificates; 34using System.Security.Cryptography.X509Certificates;
35using System.Collections.Generic; 35using System.Collections.Generic;
36using OpenSim.Framework;
36using OpenSim.Framework.Servers; 37using OpenSim.Framework.Servers;
37using OpenSim.Framework.Servers.HttpServer; 38using OpenSim.Framework.Servers.HttpServer;
38using OpenSim.Server.Base; 39using OpenSim.Server.Base;
@@ -188,6 +189,11 @@ namespace OpenSim.Server
188 189
189 int res = m_Server.Run(); 190 int res = m_Server.Run();
190 191
192 if(m_Server != null)
193 m_Server.Shutdown();
194
195 Util.StopThreadPool();
196
191 Environment.Exit(res); 197 Environment.Exit(res);
192 198
193 return 0; 199 return 0;
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
index 810da2f..2deb2d1 100644
--- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
@@ -135,8 +135,7 @@ namespace OpenSim.Services.Connectors
135 135
136 for (int i = 0 ; i < 2 ; i++) 136 for (int i = 0 ; i < 2 ; i++)
137 { 137 {
138 m_fetchThreads[i] = new Thread(AssetRequestProcessor); 138 Util.FireAndForget(delegate { AssetRequestProcessor();});
139 m_fetchThreads[i].Start();
140 } 139 }
141 } 140 }
142 141
@@ -349,8 +348,8 @@ namespace OpenSim.Services.Connectors
349 public string id; 348 public string id;
350 } 349 }
351 350
352 private OpenMetaverse.BlockingQueue<QueuedAssetRequest> m_requestQueue = 351 private OpenSim.Framework.BlockingQueue<QueuedAssetRequest> m_requestQueue =
353 new OpenMetaverse.BlockingQueue<QueuedAssetRequest>(); 352 new OpenSim.Framework.BlockingQueue<QueuedAssetRequest>();
354 353
355 private void AssetRequestProcessor() 354 private void AssetRequestProcessor()
356 { 355 {
@@ -358,8 +357,9 @@ namespace OpenSim.Services.Connectors
358 357
359 while (true) 358 while (true)
360 { 359 {
361 r = m_requestQueue.Dequeue(); 360 r = m_requestQueue.Dequeue(2000);
362 361 if(r== null)
362 continue;
363 string uri = r.uri; 363 string uri = r.uri;
364 string id = r.id; 364 string id = r.id;
365 365
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index 66e5870..8068ff5 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -271,31 +271,6 @@ namespace OpenSim.Services.Interfaces
271 m_serverURI = string.Empty; 271 m_serverURI = string.Empty;
272 } 272 }
273 273
274 /*
275 public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri)
276 {
277 m_regionLocX = regionLocX;
278 m_regionLocY = regionLocY;
279 RegionSizeX = (int)Constants.RegionSize;
280 RegionSizeY = (int)Constants.RegionSize;
281
282 m_internalEndPoint = internalEndPoint;
283 m_externalHostName = externalUri;
284 }
285
286 public GridRegion(int regionLocX, int regionLocY, string externalUri, uint port)
287 {
288 m_regionLocX = regionLocX;
289 m_regionLocY = regionLocY;
290 RegionSizeX = (int)Constants.RegionSize;
291 RegionSizeY = (int)Constants.RegionSize;
292
293 m_externalHostName = externalUri;
294
295 m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)port);
296 }
297 */
298
299 public GridRegion(uint xcell, uint ycell) 274 public GridRegion(uint xcell, uint ycell)
300 { 275 {
301 m_regionLocX = (int)Util.RegionToWorldLoc(xcell); 276 m_regionLocX = (int)Util.RegionToWorldLoc(xcell);
@@ -489,14 +464,16 @@ namespace OpenSim.Services.Interfaces
489 { 464 {
490 get 465 get
491 { 466 {
492 // Old one defaults to IPv6
493 //return new IPEndPoint(Dns.GetHostAddresses(m_externalHostName)[0], m_internalEndPoint.Port);
494
495 IPAddress ia = null; 467 IPAddress ia = null;
496 // If it is already an IP, don't resolve it - just return directly 468 // If it is already an IP, don't resolve it - just return directly
469 // we should not need this
497 if (IPAddress.TryParse(m_externalHostName, out ia)) 470 if (IPAddress.TryParse(m_externalHostName, out ia))
471 {
472 if (ia.Equals(IPAddress.Any) || ia.Equals(IPAddress.IPv6Any))
473 return null;
498 return new IPEndPoint(ia, m_internalEndPoint.Port); 474 return new IPEndPoint(ia, m_internalEndPoint.Port);
499 475 }
476
500 // Reset for next check 477 // Reset for next check
501 ia = null; 478 ia = null;
502 try 479 try
@@ -513,7 +490,7 @@ namespace OpenSim.Services.Interfaces
513 } 490 }
514 } 491 }
515 } 492 }
516 catch (SocketException e) 493 catch // (SocketException e)
517 { 494 {
518 /*throw new Exception( 495 /*throw new Exception(
519 "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" + 496 "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" +
@@ -524,6 +501,9 @@ namespace OpenSim.Services.Interfaces
524 return null; 501 return null;
525 } 502 }
526 503
504 if(ia == null)
505 return null;
506
527 return new IPEndPoint(ia, m_internalEndPoint.Port); 507 return new IPEndPoint(ia, m_internalEndPoint.Port);
528 } 508 }
529 } 509 }