diff options
author | Justin Clark-Casey (justincc) | 2014-09-05 23:20:59 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-09-05 23:20:59 +0100 |
commit | 41f2f3132bdcbfb8020c7fd6e5f3b7e48c75b1cf (patch) | |
tree | c3f55715685c213673697e09d234e82616f0dc9c /OpenSim | |
parent | Make LLUDP output queue refill thread active by default, since load tests hav... (diff) | |
download | opensim-SC-41f2f3132bdcbfb8020c7fd6e5f3b7e48c75b1cf.zip opensim-SC-41f2f3132bdcbfb8020c7fd6e5f3b7e48c75b1cf.tar.gz opensim-SC-41f2f3132bdcbfb8020c7fd6e5f3b7e48c75b1cf.tar.bz2 opensim-SC-41f2f3132bdcbfb8020c7fd6e5f3b7e48c75b1cf.tar.xz |
For monitoring purposes, start non-timeout tasks (which do not currently use a threadpool) via Watchdog.RunInThread() rather than Util.RunThreadNoTimeout()
The functionality is the same but this allow us to monitor such tasks via "show threads" and abort them for test purposes, etc.
Also extends thread names to provide more info (e.g. SendInitialDataToClient says what client the task is for).
Diffstat (limited to 'OpenSim')
11 files changed, 78 insertions, 65 deletions
diff --git a/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnectorModule.cs b/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnectorModule.cs index a750d8d..9fbc1b3 100644 --- a/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnectorModule.cs +++ b/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnectorModule.cs | |||
@@ -32,6 +32,7 @@ using System.Reflection; | |||
32 | using System.Text; | 32 | using System.Text; |
33 | 33 | ||
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Monitoring; | ||
35 | using OpenSim.Framework.Servers; | 36 | using OpenSim.Framework.Servers; |
36 | using OpenSim.Region.Framework.Scenes; | 37 | using OpenSim.Region.Framework.Scenes; |
37 | using OpenSim.Region.Framework.Interfaces; | 38 | using OpenSim.Region.Framework.Interfaces; |
@@ -560,7 +561,7 @@ namespace OpenSim.Groups | |||
560 | 561 | ||
561 | // so we have the list of urls to send the notice to | 562 | // so we have the list of urls to send the notice to |
562 | // this may take a long time... | 563 | // this may take a long time... |
563 | Util.RunThreadNoTimeout(delegate | 564 | Watchdog.RunInThread(delegate |
564 | { | 565 | { |
565 | foreach (string u in urls) | 566 | foreach (string u in urls) |
566 | { | 567 | { |
@@ -571,7 +572,7 @@ namespace OpenSim.Groups | |||
571 | hasAttachment, attType, attName, attItemID, AgentUUIForOutside(attOwnerID)); | 572 | hasAttachment, attType, attName, attItemID, AgentUUIForOutside(attOwnerID)); |
572 | } | 573 | } |
573 | } | 574 | } |
574 | }, "AddGroupNotice", null); | 575 | }, string.Format("AddGroupNotice (agent {0}, group {1})", RequestingAgentID, groupID) , null); |
575 | 576 | ||
576 | return true; | 577 | return true; |
577 | } | 578 | } |
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs index 427ed7b..e9e7bd2 100644 --- a/OpenSim/Framework/Monitoring/Watchdog.cs +++ b/OpenSim/Framework/Monitoring/Watchdog.cs | |||
@@ -187,15 +187,16 @@ namespace OpenSim.Framework.Monitoring | |||
187 | /// <param name="priority">Priority to run the thread at</param> | 187 | /// <param name="priority">Priority to run the thread at</param> |
188 | /// <param name="isBackground">True to run this thread as a background thread, otherwise false</param> | 188 | /// <param name="isBackground">True to run this thread as a background thread, otherwise false</param> |
189 | /// <param name="alarmIfTimeout">Trigger an alarm function is we have timed out</param> | 189 | /// <param name="alarmIfTimeout">Trigger an alarm function is we have timed out</param> |
190 | /// <param name="log">If true then creation of thread is logged.</param> | ||
190 | /// <returns>The newly created Thread object</returns> | 191 | /// <returns>The newly created Thread object</returns> |
191 | public static Thread StartThread( | 192 | public static Thread StartThread( |
192 | ThreadStart start, string name, ThreadPriority priority, bool isBackground, bool alarmIfTimeout) | 193 | ThreadStart start, string name, ThreadPriority priority, bool isBackground, bool alarmIfTimeout, bool log = true) |
193 | { | 194 | { |
194 | return StartThread(start, name, priority, isBackground, alarmIfTimeout, null, DEFAULT_WATCHDOG_TIMEOUT_MS); | 195 | return StartThread(start, name, priority, isBackground, alarmIfTimeout, null, DEFAULT_WATCHDOG_TIMEOUT_MS, log); |
195 | } | 196 | } |
196 | 197 | ||
197 | /// <summary> | 198 | /// <summary> |
198 | /// Start a new thread that is tracked by the watchdog timer | 199 | /// Start a new thread that is tracked by the watchdog |
199 | /// </summary> | 200 | /// </summary> |
200 | /// <param name="start">The method that will be executed in a new thread</param> | 201 | /// <param name="start">The method that will be executed in a new thread</param> |
201 | /// <param name="name">A name to give to the new thread</param> | 202 | /// <param name="name">A name to give to the new thread</param> |
@@ -208,10 +209,11 @@ namespace OpenSim.Framework.Monitoring | |||
208 | /// Normally, this will just return some useful debugging information. | 209 | /// Normally, this will just return some useful debugging information. |
209 | /// </param> | 210 | /// </param> |
210 | /// <param name="timeout">Number of milliseconds to wait until we issue a warning about timeout.</param> | 211 | /// <param name="timeout">Number of milliseconds to wait until we issue a warning about timeout.</param> |
212 | /// <param name="log">If true then creation of thread is logged.</param> | ||
211 | /// <returns>The newly created Thread object</returns> | 213 | /// <returns>The newly created Thread object</returns> |
212 | public static Thread StartThread( | 214 | public static Thread StartThread( |
213 | ThreadStart start, string name, ThreadPriority priority, bool isBackground, | 215 | ThreadStart start, string name, ThreadPriority priority, bool isBackground, |
214 | bool alarmIfTimeout, Func<string> alarmMethod, int timeout) | 216 | bool alarmIfTimeout, Func<string> alarmMethod, int timeout, bool log = true) |
215 | { | 217 | { |
216 | Thread thread = new Thread(start); | 218 | Thread thread = new Thread(start); |
217 | thread.Name = name; | 219 | thread.Name = name; |
@@ -222,8 +224,9 @@ namespace OpenSim.Framework.Monitoring | |||
222 | = new ThreadWatchdogInfo(thread, timeout) | 224 | = new ThreadWatchdogInfo(thread, timeout) |
223 | { AlarmIfTimeout = alarmIfTimeout, AlarmMethod = alarmMethod }; | 225 | { AlarmIfTimeout = alarmIfTimeout, AlarmMethod = alarmMethod }; |
224 | 226 | ||
225 | m_log.DebugFormat( | 227 | if (log) |
226 | "[WATCHDOG]: Started tracking thread {0}, ID {1}", twi.Thread.Name, twi.Thread.ManagedThreadId); | 228 | m_log.DebugFormat( |
229 | "[WATCHDOG]: Started tracking thread {0}, ID {1}", twi.Thread.Name, twi.Thread.ManagedThreadId); | ||
227 | 230 | ||
228 | lock (m_threads) | 231 | lock (m_threads) |
229 | m_threads.Add(twi.Thread.ManagedThreadId, twi); | 232 | m_threads.Add(twi.Thread.ManagedThreadId, twi); |
@@ -234,6 +237,39 @@ namespace OpenSim.Framework.Monitoring | |||
234 | } | 237 | } |
235 | 238 | ||
236 | /// <summary> | 239 | /// <summary> |
240 | /// Run the callback in a new thread immediately. If the thread exits with an exception log it but do | ||
241 | /// not propogate it. | ||
242 | /// </summary> | ||
243 | /// <param name="callback">Code for the thread to execute.</param> | ||
244 | /// <param name="name">Name of the thread</param> | ||
245 | /// <param name="obj">Object to pass to the thread.</param> | ||
246 | public static void RunInThread(WaitCallback callback, string name, object obj, bool log = false) | ||
247 | { | ||
248 | if (Util.FireAndForgetMethod == FireAndForgetMethod.RegressionTest) | ||
249 | { | ||
250 | Culture.SetCurrentCulture(); | ||
251 | callback(obj); | ||
252 | return; | ||
253 | } | ||
254 | |||
255 | ThreadStart ts = new ThreadStart(delegate() | ||
256 | { | ||
257 | try | ||
258 | { | ||
259 | Culture.SetCurrentCulture(); | ||
260 | callback(obj); | ||
261 | Watchdog.RemoveThread(log:false); | ||
262 | } | ||
263 | catch (Exception e) | ||
264 | { | ||
265 | m_log.Error(string.Format("[WATCHDOG]: Exception in thread {0}.", name), e); | ||
266 | } | ||
267 | }); | ||
268 | |||
269 | StartThread(ts, name, ThreadPriority.Normal, true, false, log:log); | ||
270 | } | ||
271 | |||
272 | /// <summary> | ||
237 | /// Marks the current thread as alive | 273 | /// Marks the current thread as alive |
238 | /// </summary> | 274 | /// </summary> |
239 | public static void UpdateThread() | 275 | public static void UpdateThread() |
@@ -244,24 +280,26 @@ namespace OpenSim.Framework.Monitoring | |||
244 | /// <summary> | 280 | /// <summary> |
245 | /// Stops watchdog tracking on the current thread | 281 | /// Stops watchdog tracking on the current thread |
246 | /// </summary> | 282 | /// </summary> |
283 | /// <param name="log">If true then normal events in thread removal are not logged.</param> | ||
247 | /// <returns> | 284 | /// <returns> |
248 | /// True if the thread was removed from the list of tracked | 285 | /// True if the thread was removed from the list of tracked |
249 | /// threads, otherwise false | 286 | /// threads, otherwise false |
250 | /// </returns> | 287 | /// </returns> |
251 | public static bool RemoveThread() | 288 | public static bool RemoveThread(bool log = true) |
252 | { | 289 | { |
253 | return RemoveThread(Thread.CurrentThread.ManagedThreadId); | 290 | return RemoveThread(Thread.CurrentThread.ManagedThreadId, log); |
254 | } | 291 | } |
255 | 292 | ||
256 | private static bool RemoveThread(int threadID) | 293 | private static bool RemoveThread(int threadID, bool log = true) |
257 | { | 294 | { |
258 | lock (m_threads) | 295 | lock (m_threads) |
259 | { | 296 | { |
260 | ThreadWatchdogInfo twi; | 297 | ThreadWatchdogInfo twi; |
261 | if (m_threads.TryGetValue(threadID, out twi)) | 298 | if (m_threads.TryGetValue(threadID, out twi)) |
262 | { | 299 | { |
263 | m_log.DebugFormat( | 300 | if (log) |
264 | "[WATCHDOG]: Removing thread {0}, ID {1}", twi.Thread.Name, twi.Thread.ManagedThreadId); | 301 | m_log.DebugFormat( |
302 | "[WATCHDOG]: Removing thread {0}, ID {1}", twi.Thread.Name, twi.Thread.ManagedThreadId); | ||
265 | 303 | ||
266 | twi.Cleanup(); | 304 | twi.Cleanup(); |
267 | m_threads.Remove(threadID); | 305 | m_threads.Remove(threadID); |
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 2c38571..fefa050 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -2400,36 +2400,6 @@ namespace OpenSim.Framework | |||
2400 | #endregion FireAndForget Threading Pattern | 2400 | #endregion FireAndForget Threading Pattern |
2401 | 2401 | ||
2402 | /// <summary> | 2402 | /// <summary> |
2403 | /// Run the callback on a different thread, outside the thread pool. This is used for tasks | ||
2404 | /// that may take a long time. | ||
2405 | /// </summary> | ||
2406 | public static void RunThreadNoTimeout(WaitCallback callback, string name, object obj) | ||
2407 | { | ||
2408 | if (FireAndForgetMethod == FireAndForgetMethod.RegressionTest) | ||
2409 | { | ||
2410 | Culture.SetCurrentCulture(); | ||
2411 | callback(obj); | ||
2412 | return; | ||
2413 | } | ||
2414 | |||
2415 | Thread t = new Thread(delegate() | ||
2416 | { | ||
2417 | try | ||
2418 | { | ||
2419 | Culture.SetCurrentCulture(); | ||
2420 | callback(obj); | ||
2421 | } | ||
2422 | catch (Exception e) | ||
2423 | { | ||
2424 | m_log.Error("Exception in thread " + name, e); | ||
2425 | } | ||
2426 | }); | ||
2427 | |||
2428 | t.Name = name; | ||
2429 | t.Start(); | ||
2430 | } | ||
2431 | |||
2432 | /// <summary> | ||
2433 | /// Environment.TickCount is an int but it counts all 32 bits so it goes positive | 2403 | /// Environment.TickCount is an int but it counts all 32 bits so it goes positive |
2434 | /// and negative every 24.9 days. This trims down TickCount so it doesn't wrap | 2404 | /// and negative every 24.9 days. This trims down TickCount so it doesn't wrap |
2435 | /// for the callers. | 2405 | /// for the callers. |
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index f06d70d..9d6870f 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | |||
@@ -43,6 +43,7 @@ using Mono.Addins; | |||
43 | using OpenMetaverse; | 43 | using OpenMetaverse; |
44 | using OpenSim.Framework; | 44 | using OpenSim.Framework; |
45 | using OpenSim.Framework.Console; | 45 | using OpenSim.Framework.Console; |
46 | using OpenSim.Framework.Monitoring; | ||
46 | using OpenSim.Region.Framework.Interfaces; | 47 | using OpenSim.Region.Framework.Interfaces; |
47 | using OpenSim.Region.Framework.Scenes; | 48 | using OpenSim.Region.Framework.Scenes; |
48 | using OpenSim.Services.Interfaces; | 49 | using OpenSim.Services.Interfaces; |
@@ -963,7 +964,8 @@ namespace OpenSim.Region.CoreModules.Asset | |||
963 | case "assets": | 964 | case "assets": |
964 | con.Output("Ensuring assets are cached for all scenes."); | 965 | con.Output("Ensuring assets are cached for all scenes."); |
965 | 966 | ||
966 | Util.RunThreadNoTimeout(delegate { | 967 | Watchdog.RunInThread(delegate |
968 | { | ||
967 | int assetReferenceTotal = TouchAllSceneAssets(true); | 969 | int assetReferenceTotal = TouchAllSceneAssets(true); |
968 | con.OutputFormat("Completed check with {0} assets.", assetReferenceTotal); | 970 | con.OutputFormat("Completed check with {0} assets.", assetReferenceTotal); |
969 | }, "TouchAllSceneAssets", null); | 971 | }, "TouchAllSceneAssets", null); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index d15703e..a5b5aa2 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -34,6 +34,7 @@ using System.Xml; | |||
34 | using log4net; | 34 | using log4net; |
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Monitoring; | ||
37 | using OpenSim.Framework.Serialization; | 38 | using OpenSim.Framework.Serialization; |
38 | using OpenSim.Framework.Serialization.External; | 39 | using OpenSim.Framework.Serialization.External; |
39 | using OpenSim.Region.CoreModules.World.Archiver; | 40 | using OpenSim.Region.CoreModules.World.Archiver; |
@@ -356,7 +357,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
356 | m_scene.UserAccountService, m_scene.RegionInfo.ScopeID, | 357 | m_scene.UserAccountService, m_scene.RegionInfo.ScopeID, |
357 | options, ReceivedAllAssets); | 358 | options, ReceivedAllAssets); |
358 | 359 | ||
359 | Util.RunThreadNoTimeout(o => ar.Execute(), "AssetsRequest", null); | 360 | Watchdog.RunInThread(o => ar.Execute(), string.Format("AssetsRequest ({0})", m_scene.Name), null); |
360 | } | 361 | } |
361 | else | 362 | else |
362 | { | 363 | { |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index f80fab3..470ef02 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -33,6 +33,7 @@ using System; | |||
33 | using System.Collections.Generic; | 33 | using System.Collections.Generic; |
34 | using System.Reflection; | 34 | using System.Reflection; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Monitoring; | ||
36 | using OpenSim.Data; | 37 | using OpenSim.Data; |
37 | using OpenSim.Server.Base; | 38 | using OpenSim.Server.Base; |
38 | using OpenSim.Region.Framework.Interfaces; | 39 | using OpenSim.Region.Framework.Interfaces; |
@@ -183,12 +184,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
183 | // Protect ourselves against the caller subsequently modifying the items list | 184 | // Protect ourselves against the caller subsequently modifying the items list |
184 | List<InventoryItemBase> items = new List<InventoryItemBase>(invCol.Items); | 185 | List<InventoryItemBase> items = new List<InventoryItemBase>(invCol.Items); |
185 | 186 | ||
186 | Util.RunThreadNoTimeout(delegate | 187 | Watchdog.RunInThread(delegate |
187 | { | 188 | { |
188 | foreach (InventoryItemBase item in items) | 189 | foreach (InventoryItemBase item in items) |
189 | if (!string.IsNullOrEmpty(item.CreatorData)) | 190 | if (!string.IsNullOrEmpty(item.CreatorData)) |
190 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); | 191 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); |
191 | }, "GetFolderContent", null); | 192 | }, string.Format("GetFolderContent (user {0}, folder {1})", userID, folderID), null); |
192 | } | 193 | } |
193 | 194 | ||
194 | return invCol; | 195 | return invCol; |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index c8056d4..3e0c9f3 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -36,6 +36,7 @@ using System.Xml; | |||
36 | using log4net; | 36 | using log4net; |
37 | using OpenMetaverse; | 37 | using OpenMetaverse; |
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Monitoring; | ||
39 | using OpenSim.Framework.Serialization; | 40 | using OpenSim.Framework.Serialization; |
40 | using OpenSim.Framework.Serialization.External; | 41 | using OpenSim.Framework.Serialization.External; |
41 | using OpenSim.Region.CoreModules.World.Terrain; | 42 | using OpenSim.Region.CoreModules.World.Terrain; |
@@ -371,7 +372,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
371 | // Start the scripts. We delayed this because we want the OAR to finish loading ASAP, so | 372 | // Start the scripts. We delayed this because we want the OAR to finish loading ASAP, so |
372 | // that users can enter the scene. If we allow the scripts to start in the loop above | 373 | // that users can enter the scene. If we allow the scripts to start in the loop above |
373 | // then they significantly increase the time until the OAR finishes loading. | 374 | // then they significantly increase the time until the OAR finishes loading. |
374 | Util.RunThreadNoTimeout(delegate(object o) | 375 | Watchdog.RunInThread(o => |
375 | { | 376 | { |
376 | Thread.Sleep(15000); | 377 | Thread.Sleep(15000); |
377 | m_log.Info("[ARCHIVER]: Starting scripts in scene objects"); | 378 | m_log.Info("[ARCHIVER]: Starting scripts in scene objects"); |
@@ -386,7 +387,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
386 | 387 | ||
387 | sceneContext.SceneObjects.Clear(); | 388 | sceneContext.SceneObjects.Clear(); |
388 | } | 389 | } |
389 | }, "ReadArchiveStartScripts", null); | 390 | }, string.Format("ReadArchiveStartScripts (request {0})", m_requestId), null); |
390 | 391 | ||
391 | m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); | 392 | m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); |
392 | 393 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs index 448147a..803f24e 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs | |||
@@ -36,6 +36,7 @@ using System.Xml; | |||
36 | using log4net; | 36 | using log4net; |
37 | using OpenMetaverse; | 37 | using OpenMetaverse; |
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Monitoring; | ||
39 | using OpenSim.Framework.Serialization; | 40 | using OpenSim.Framework.Serialization; |
40 | using OpenSim.Region.CoreModules.World.Terrain; | 41 | using OpenSim.Region.CoreModules.World.Terrain; |
41 | using OpenSim.Region.Framework.Interfaces; | 42 | using OpenSim.Region.Framework.Interfaces; |
@@ -199,7 +200,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
199 | m_rootScene.AssetService, m_rootScene.UserAccountService, | 200 | m_rootScene.AssetService, m_rootScene.UserAccountService, |
200 | m_rootScene.RegionInfo.ScopeID, options, ReceivedAllAssets); | 201 | m_rootScene.RegionInfo.ScopeID, options, ReceivedAllAssets); |
201 | 202 | ||
202 | Util.RunThreadNoTimeout(o => ar.Execute(), "AssetsRequest", null); | 203 | Watchdog.RunInThread(o => ar.Execute(), "Archive Assets Request", null); |
203 | 204 | ||
204 | // CloseArchive() will be called from ReceivedAllAssets() | 205 | // CloseArchive() will be called from ReceivedAllAssets() |
205 | } | 206 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index 4f428c3..ec39bc0 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | |||
@@ -33,6 +33,7 @@ using System.Timers; | |||
33 | using log4net; | 33 | using log4net; |
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Monitoring; | ||
36 | using OpenSim.Framework.Serialization; | 37 | using OpenSim.Framework.Serialization; |
37 | using OpenSim.Framework.Serialization.External; | 38 | using OpenSim.Framework.Serialization.External; |
38 | using OpenSim.Services.Interfaces; | 39 | using OpenSim.Services.Interfaces; |
@@ -226,7 +227,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
226 | finally | 227 | finally |
227 | { | 228 | { |
228 | if (timedOut) | 229 | if (timedOut) |
229 | Util.RunThreadNoTimeout(PerformAssetsRequestCallback, "AssetsRequestCallback", true); | 230 | Watchdog.RunInThread(PerformAssetsRequestCallback, "Archive Assets Request Callback", true); |
230 | } | 231 | } |
231 | } | 232 | } |
232 | 233 | ||
@@ -295,7 +296,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
295 | 296 | ||
296 | // We want to stop using the asset cache thread asap | 297 | // We want to stop using the asset cache thread asap |
297 | // as we now need to do the work of producing the rest of the archive | 298 | // as we now need to do the work of producing the rest of the archive |
298 | Util.RunThreadNoTimeout(PerformAssetsRequestCallback, "AssetsRequestCallback", false); | 299 | Watchdog.RunInThread(PerformAssetsRequestCallback, "Archive Assets Request Callback", false); |
299 | } | 300 | } |
300 | else | 301 | else |
301 | { | 302 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5f0dbd7..28dbccb 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1623,7 +1623,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1623 | { | 1623 | { |
1624 | tmpMS = Util.EnvironmentTickCount(); | 1624 | tmpMS = Util.EnvironmentTickCount(); |
1625 | m_cleaningTemps = true; | 1625 | m_cleaningTemps = true; |
1626 | Util.RunThreadNoTimeout(delegate { CleanTempObjects(); m_cleaningTemps = false; }, "CleanTempObjects", null); | 1626 | |
1627 | Watchdog.RunInThread( | ||
1628 | delegate { CleanTempObjects(); m_cleaningTemps = false; }, | ||
1629 | string.Format("CleanTempObjects ({0})", Name), | ||
1630 | null); | ||
1631 | |||
1627 | tempOnRezMS = Util.EnvironmentTickCountSubtract(tmpMS); | 1632 | tempOnRezMS = Util.EnvironmentTickCountSubtract(tmpMS); |
1628 | } | 1633 | } |
1629 | 1634 | ||
@@ -1803,7 +1808,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1803 | if (!m_backingup) | 1808 | if (!m_backingup) |
1804 | { | 1809 | { |
1805 | m_backingup = true; | 1810 | m_backingup = true; |
1806 | Util.RunThreadNoTimeout(BackupWaitCallback, "BackupWaitCallback", null); | 1811 | Watchdog.RunInThread(o => Backup(false), string.Format("BackupWaitCallback ({0})", Name), null); |
1807 | } | 1812 | } |
1808 | } | 1813 | } |
1809 | 1814 | ||
@@ -1814,14 +1819,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1814 | { | 1819 | { |
1815 | m_eventManager.TriggerOnFrame(); | 1820 | m_eventManager.TriggerOnFrame(); |
1816 | } | 1821 | } |
1817 | |||
1818 | /// <summary> | ||
1819 | /// Wrapper for Backup() that can be called with Util.RunThreadNoTimeout() | ||
1820 | /// </summary> | ||
1821 | private void BackupWaitCallback(object o) | ||
1822 | { | ||
1823 | Backup(false); | ||
1824 | } | ||
1825 | 1822 | ||
1826 | /// <summary> | 1823 | /// <summary> |
1827 | /// Backup the scene. | 1824 | /// Backup the scene. |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3c37de8..59b521d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -37,6 +37,7 @@ using log4net; | |||
37 | using Nini.Config; | 37 | using Nini.Config; |
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Client; | 39 | using OpenSim.Framework.Client; |
40 | using OpenSim.Framework.Monitoring; | ||
40 | using OpenSim.Region.Framework.Interfaces; | 41 | using OpenSim.Region.Framework.Interfaces; |
41 | using OpenSim.Region.Framework.Scenes.Animation; | 42 | using OpenSim.Region.Framework.Scenes.Animation; |
42 | using OpenSim.Region.Framework.Scenes.Types; | 43 | using OpenSim.Region.Framework.Scenes.Types; |
@@ -3362,7 +3363,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3362 | SentInitialDataToClient = true; | 3363 | SentInitialDataToClient = true; |
3363 | 3364 | ||
3364 | // Send all scene object to the new client | 3365 | // Send all scene object to the new client |
3365 | Util.RunThreadNoTimeout(delegate | 3366 | Watchdog.RunInThread(delegate |
3366 | { | 3367 | { |
3367 | // m_log.DebugFormat( | 3368 | // m_log.DebugFormat( |
3368 | // "[SCENE PRESENCE]: Sending initial data to {0} agent {1} in {2}, tp flags {3}", | 3369 | // "[SCENE PRESENCE]: Sending initial data to {0} agent {1} in {2}, tp flags {3}", |
@@ -3380,8 +3381,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3380 | if (e != null && e is SceneObjectGroup) | 3381 | if (e != null && e is SceneObjectGroup) |
3381 | ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); | 3382 | ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); |
3382 | } | 3383 | } |
3383 | 3384 | }, string.Format("SendInitialDataToClient ({0} in {1})", Name, Scene.Name), null); | |
3384 | }, "SendInitialDataToClient", null); | ||
3385 | } | 3385 | } |
3386 | 3386 | ||
3387 | /// <summary> | 3387 | /// <summary> |