diff options
author | UbitUmarov | 2017-05-23 07:35:02 +0100 |
---|---|---|
committer | UbitUmarov | 2017-05-23 07:35:02 +0100 |
commit | c0bfaac0ac6873720b7c3721436ca54e93d5072c (patch) | |
tree | 62f6b02569ba6dd968d76ad9bf2aa6ccf839d588 /OpenSim/Framework | |
parent | reenqueue poll events while conn is open, and not expired (diff) | |
parent | dont log timeouts on stopped threads (diff) | |
download | opensim-SC-c0bfaac0ac6873720b7c3721436ca54e93d5072c.zip opensim-SC-c0bfaac0ac6873720b7c3721436ca54e93d5072c.tar.gz opensim-SC-c0bfaac0ac6873720b7c3721436ca54e93d5072c.tar.bz2 opensim-SC-c0bfaac0ac6873720b7c3721436ca54e93d5072c.tar.xz |
merge master
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Client/IClientIPEndpoint.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/WorkManager.cs | 6 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/BaseOpenSimServer.cs | 11 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 25 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/MainServer.cs | 12 |
5 files changed, 41 insertions, 15 deletions
diff --git a/OpenSim/Framework/Client/IClientIPEndpoint.cs b/OpenSim/Framework/Client/IClientIPEndpoint.cs index 2b99bf0..2194616 100644 --- a/OpenSim/Framework/Client/IClientIPEndpoint.cs +++ b/OpenSim/Framework/Client/IClientIPEndpoint.cs | |||
@@ -34,6 +34,6 @@ namespace OpenSim.Framework.Client | |||
34 | { | 34 | { |
35 | public interface IClientIPEndpoint | 35 | public interface IClientIPEndpoint |
36 | { | 36 | { |
37 | IPAddress EndPoint { get; } | 37 | IPEndPoint RemoteEndPoint { get; } |
38 | } | 38 | } |
39 | } | 39 | } |
diff --git a/OpenSim/Framework/Monitoring/WorkManager.cs b/OpenSim/Framework/Monitoring/WorkManager.cs index 43130f9..a3e0390 100644 --- a/OpenSim/Framework/Monitoring/WorkManager.cs +++ b/OpenSim/Framework/Monitoring/WorkManager.cs | |||
@@ -82,6 +82,11 @@ namespace OpenSim.Framework.Monitoring | |||
82 | HandleControlCommand); | 82 | HandleControlCommand); |
83 | } | 83 | } |
84 | 84 | ||
85 | public static void Stop() | ||
86 | { | ||
87 | JobEngine.Stop(); | ||
88 | } | ||
89 | |||
85 | /// <summary> | 90 | /// <summary> |
86 | /// Start a new long-lived thread. | 91 | /// Start a new long-lived thread. |
87 | /// </summary> | 92 | /// </summary> |
@@ -131,7 +136,6 @@ namespace OpenSim.Framework.Monitoring | |||
131 | 136 | ||
132 | thread.Start(); | 137 | thread.Start(); |
133 | 138 | ||
134 | |||
135 | return thread; | 139 | return thread; |
136 | } | 140 | } |
137 | 141 | ||
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index c7f0136..2834d94 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -136,12 +136,19 @@ namespace OpenSim.Framework.Servers | |||
136 | 136 | ||
137 | protected override void ShutdownSpecific() | 137 | protected override void ShutdownSpecific() |
138 | { | 138 | { |
139 | m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting..."); | ||
140 | 139 | ||
141 | RemovePIDFile(); | ||
142 | 140 | ||
143 | base.ShutdownSpecific(); | 141 | base.ShutdownSpecific(); |
144 | 142 | ||
143 | MainServer.Stop(); | ||
144 | |||
145 | Thread.Sleep(5000); | ||
146 | |||
147 | WorkManager.Stop(); | ||
148 | |||
149 | RemovePIDFile(); | ||
150 | m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting..."); | ||
151 | |||
145 | if (!SuppressExit) | 152 | if (!SuppressExit) |
146 | Environment.Exit(0); | 153 | Environment.Exit(0); |
147 | } | 154 | } |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index cb0c41f..94a9490 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -194,17 +194,20 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
194 | { | 194 | { |
195 | m_running = false; | 195 | m_running = false; |
196 | 196 | ||
197 | Thread.Sleep(1000); // let the world move | 197 | Thread.Sleep(100); // let the world move |
198 | 198 | ||
199 | foreach (Thread t in m_workerThreads) | 199 | foreach (Thread t in m_workerThreads) |
200 | Watchdog.AbortThread(t.ManagedThreadId); | 200 | Watchdog.AbortThread(t.ManagedThreadId); |
201 | 201 | ||
202 | m_threadPool.Shutdown(); | ||
203 | |||
202 | // any entry in m_bycontext should have a active request on the other queues | 204 | // any entry in m_bycontext should have a active request on the other queues |
203 | // so just delete contents to easy GC | 205 | // so just delete contents to easy GC |
204 | foreach (Queue<PollServiceHttpRequest> qu in m_bycontext.Values) | 206 | foreach (Queue<PollServiceHttpRequest> qu in m_bycontext.Values) |
205 | qu.Clear(); | 207 | qu.Clear(); |
206 | m_bycontext.Clear(); | 208 | m_bycontext.Clear(); |
207 | 209 | ||
210 | /* | ||
208 | try | 211 | try |
209 | { | 212 | { |
210 | foreach (PollServiceHttpRequest req in m_retryRequests) | 213 | foreach (PollServiceHttpRequest req in m_retryRequests) |
@@ -217,8 +220,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
217 | } | 220 | } |
218 | 221 | ||
219 | PollServiceHttpRequest wreq; | 222 | PollServiceHttpRequest wreq; |
223 | */ | ||
220 | m_retryRequests.Clear(); | 224 | m_retryRequests.Clear(); |
221 | 225 | /* | |
222 | while (m_requests.Count() > 0) | 226 | while (m_requests.Count() > 0) |
223 | { | 227 | { |
224 | try | 228 | try |
@@ -231,7 +235,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
231 | { | 235 | { |
232 | } | 236 | } |
233 | } | 237 | } |
234 | 238 | */ | |
235 | m_requests.Clear(); | 239 | m_requests.Clear(); |
236 | } | 240 | } |
237 | 241 | ||
@@ -242,7 +246,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
242 | while (m_running) | 246 | while (m_running) |
243 | { | 247 | { |
244 | PollServiceHttpRequest req = m_requests.Dequeue(5000); | 248 | PollServiceHttpRequest req = m_requests.Dequeue(5000); |
245 | |||
246 | Watchdog.UpdateThread(); | 249 | Watchdog.UpdateThread(); |
247 | if(req == null) | 250 | if(req == null) |
248 | continue; | 251 | continue; |
@@ -277,16 +280,16 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
277 | try | 280 | try |
278 | { | 281 | { |
279 | req.DoHTTPGruntWork(m_server, responsedata); | 282 | req.DoHTTPGruntWork(m_server, responsedata); |
283 | } | ||
284 | catch (ObjectDisposedException) { } | ||
285 | finally | ||
286 | { | ||
280 | if(req.HttpContext.CanSend() && req.PollServiceArgs.Type == PollServiceEventArgs.EventType.Poll | 287 | if(req.HttpContext.CanSend() && req.PollServiceArgs.Type == PollServiceEventArgs.EventType.Poll |
281 | && (Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) | 288 | && (Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) |
282 | ReQueueEvent(req); | 289 | ReQueueEvent(req); |
283 | else | 290 | else |
284 | byContextDequeue(req); | 291 | byContextDequeue(req); |
285 | } | 292 | } |
286 | catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream | ||
287 | { | ||
288 | // Ignore it, no need to reply | ||
289 | } | ||
290 | return null; | 293 | return null; |
291 | }, null); | 294 | }, null); |
292 | } | 295 | } |
@@ -300,11 +303,11 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
300 | { | 303 | { |
301 | req.DoHTTPGruntWork(m_server, | 304 | req.DoHTTPGruntWork(m_server, |
302 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); | 305 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); |
303 | byContextDequeue(req); | ||
304 | } | 306 | } |
305 | catch (ObjectDisposedException) | 307 | catch (ObjectDisposedException) {} |
308 | finally | ||
306 | { | 309 | { |
307 | // Ignore it, no need to reply | 310 | byContextDequeue(req); |
308 | } | 311 | } |
309 | return null; | 312 | return null; |
310 | }, null); | 313 | }, null); |
diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs index 29308a9..7ecd383 100644 --- a/OpenSim/Framework/Servers/MainServer.cs +++ b/OpenSim/Framework/Servers/MainServer.cs | |||
@@ -369,5 +369,17 @@ namespace OpenSim.Framework.Servers | |||
369 | return m_Servers[port]; | 369 | return m_Servers[port]; |
370 | } | 370 | } |
371 | } | 371 | } |
372 | |||
373 | public static void Stop() | ||
374 | { | ||
375 | lock (m_Servers) | ||
376 | { | ||
377 | foreach (BaseHttpServer httpServer in m_Servers.Values) | ||
378 | { | ||
379 | httpServer.Stop(); | ||
380 | } | ||
381 | } | ||
382 | } | ||
383 | |||
372 | } | 384 | } |
373 | } \ No newline at end of file | 385 | } \ No newline at end of file |