diff options
author | UbitUmarov | 2017-05-25 10:23:52 +0100 |
---|---|---|
committer | UbitUmarov | 2017-05-25 10:23:52 +0100 |
commit | 27779953315e160067080b6f17945ab54695d63f (patch) | |
tree | 36e66eeaf84fd48382ab89278c7b150723a45235 /OpenSim/Framework | |
parent | merge master (diff) | |
parent | add some checks for valid endpoints (diff) | |
download | opensim-SC-27779953315e160067080b6f17945ab54695d63f.zip opensim-SC-27779953315e160067080b6f17945ab54695d63f.tar.gz opensim-SC-27779953315e160067080b6f17945ab54695d63f.tar.bz2 opensim-SC-27779953315e160067080b6f17945ab54695d63f.tar.xz |
Merge branch 'master' into httptests
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Monitoring/Watchdog.cs | 24 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/WorkManager.cs | 1 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/BaseOpenSimServer.cs | 11 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 11 |
5 files changed, 43 insertions, 8 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> |