From ec8d21c434a39f46518ee9cf9f5539d1790eacc0 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 4 Nov 2014 00:55:48 +0000 Subject: [PATCH] Label all threadpool calls being made in core OpenSimulator. This is to add problem diagnosis. "show threadpool calls" now also returns named (labelled), anonymous (unlabelled) and total call stats. --- .../Framework/Communications/RestClient.cs | 2 +- OpenSim/Framework/Servers/ServerBase.cs | 8 +++++++ OpenSim/Framework/Util.cs | 23 +++++++++++-------- .../ClientStack/Linden/UDP/LLClientView.cs | 9 ++++---- .../ClientStack/Linden/UDP/LLUDPClient.cs | 2 +- .../ClientStack/Linden/UDP/LLUDPServer.cs | 8 ++++--- .../Agent/TextureSender/J2KDecoderModule.cs | 2 +- .../CoreModules/Asset/FlotsamAssetCache.cs | 2 +- .../AvatarFactory/AvatarFactoryModule.cs | 6 ++--- .../Avatar/BakedTextures/XBakesModule.cs | 2 +- .../Avatar/Friends/FriendsModule.cs | 2 +- .../Avatar/Friends/HGFriendsModule.cs | 6 +++-- .../InstantMessage/HGMessageTransferModule.cs | 2 +- .../Avatar/UserProfiles/UserProfileModule.cs | 2 +- .../EntityTransfer/HGEntityTransferModule.cs | 2 +- .../Asset/HGAssetBroker.cs | 2 +- .../Asset/LocalAssetServiceConnector.cs | 6 +++-- .../Scenes/SceneCommunicationService.cs | 5 +++- .../Region/Framework/Scenes/ScenePresence.cs | 10 ++++---- .../JsonStore/JsonStoreScriptModule.cs | 21 +++++++++++------ .../ViewerSupport/DynamicMenuModule.cs | 3 ++- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 2 +- .../Shared/Api/Implementation/LSL_Api.cs | 8 +++---- .../Shared/Api/Implementation/OSSL_Api.cs | 16 ++++++++----- .../Handlers/Simulation/AgentHandlers.cs | 3 ++- .../SimianGrid/SimianActivityDetector.cs | 4 ++-- .../SimianGrid/SimianAssetServiceConnector.cs | 2 +- .../HypergridService/HGFriendsService.cs | 3 ++- .../MapImageService/MapImageService.cs | 3 ++- .../Stress/VectorRenderModuleStressTests.cs | 2 +- 30 files changed, 103 insertions(+), 65 deletions(-) diff --git a/OpenSim/Framework/Communications/RestClient.cs b/OpenSim/Framework/Communications/RestClient.cs index de6fe30b5b..72018e46e0 100644 --- a/OpenSim/Framework/Communications/RestClient.cs +++ b/OpenSim/Framework/Communications/RestClient.cs @@ -483,7 +483,7 @@ namespace OpenSim.Framework.Communications /// In case, we are invoked asynchroneously this object will keep track of the state /// AsyncResult ar = new AsyncResult(callback, state); - Util.FireAndForget(RequestHelper, ar); + Util.FireAndForget(RequestHelper, ar, "RestClient.BeginRequest"); return ar; } diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs index 379e224855..eb9fb8b4bb 100644 --- a/OpenSim/Framework/Servers/ServerBase.cs +++ b/OpenSim/Framework/Servers/ServerBase.cs @@ -365,13 +365,21 @@ namespace OpenSim.Framework.Servers { List> calls = Util.GetFireAndForgetCallsMade().ToList(); calls.Sort((kvp1, kvp2) => kvp2.Value.CompareTo(kvp1.Value)); + int namedCallsMade = 0; ConsoleDisplayList cdl = new ConsoleDisplayList(); foreach (KeyValuePair kvp in calls) { cdl.AddRow(kvp.Key, kvp.Value); + namedCallsMade += kvp.Value; } + cdl.AddRow("TOTAL NAMED", namedCallsMade); + + long allCallsMade = Util.TotalFireAndForgetCallsMade; + cdl.AddRow("TOTAL ANONYMOUS", allCallsMade - namedCallsMade); + cdl.AddRow("TOTAL ALL", allCallsMade); + MainConsole.Instance.Output(cdl.ToString()); } diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 53bbb066e5..baad0b90d6 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -1928,11 +1928,6 @@ namespace OpenSim.Framework } } - public static void FireAndForget(System.Threading.WaitCallback callback) - { - FireAndForget(callback, null, null); - } - public static void InitThreadPool(int minThreads, int maxThreads) { if (maxThreads < 2) @@ -1977,8 +1972,7 @@ namespace OpenSim.Framework throw new NotImplementedException(); } } - - + /// /// Additional information about threads in the main thread pool. Used to time how long the /// thread has been running, and abort it if it has timed-out. @@ -2052,10 +2046,10 @@ namespace OpenSim.Framework } } - private static long nextThreadFuncNum = 0; private static long numQueuedThreadFuncs = 0; private static long numRunningThreadFuncs = 0; + private static long numTotalThreadFuncsCalled = 0; private static Int32 threadFuncOverloadMode = 0; // Maps (ThreadFunc number -> Thread) @@ -2086,20 +2080,29 @@ namespace OpenSim.Framework } } + public static long TotalFireAndForgetCallsMade { get { return numTotalThreadFuncsCalled; } } + public static Dictionary GetFireAndForgetCallsMade() { return new Dictionary(m_fireAndForgetCallsMade); - } + } private static Dictionary m_fireAndForgetCallsMade = new Dictionary(); + public static void FireAndForget(System.Threading.WaitCallback callback) + { + FireAndForget(callback, null, null); + } + public static void FireAndForget(System.Threading.WaitCallback callback, object obj) { FireAndForget(callback, obj, null); } - + public static void FireAndForget(System.Threading.WaitCallback callback, object obj, string context) { + Interlocked.Increment(ref numTotalThreadFuncsCalled); + if (context != null) { if (!m_fireAndForgetCallsMade.ContainsKey(context)) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index c8c00c83ee..516327ccb7 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -1161,7 +1161,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// heightmap public virtual void SendLayerData(float[] map) { - Util.FireAndForget(DoSendLayerData, m_scene.Heightmap.GetTerrainData()); + Util.FireAndForget(DoSendLayerData, m_scene.Heightmap.GetTerrainData(), "LLClientView.DoSendLayerData"); } /// @@ -1373,7 +1373,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// 16x16 array of wind speeds public virtual void SendWindData(Vector2[] windSpeeds) { - Util.FireAndForget(DoSendWindData, windSpeeds); + Util.FireAndForget(DoSendWindData, windSpeeds, "LLClientView.SendWindData"); } /// @@ -1382,7 +1382,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// 16x16 array of cloud densities public virtual void SendCloudData(float[] cloudDensity) { - Util.FireAndForget(DoSendCloudData, cloudDensity); + Util.FireAndForget(DoSendCloudData, cloudDensity, "LLClientView.SendCloudData"); } /// @@ -8093,7 +8093,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP { // This requests the asset if needed HandleSimInventoryTransferRequestWithPermsCheck(sender, transfer); - }); + }, null, "LLClientView.HandleTransferRequest"); + return true; } } diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index b70d861279..8f14806206 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs @@ -732,7 +732,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (!m_udpServer.OqrEngine.IsRunning) { // Asynchronously run the callback - Util.FireAndForget(FireQueueEmpty, categories); + Util.FireAndForget(FireQueueEmpty, categories, "LLUDPClient.BeginFireQueueEmpty"); } else { diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index aa103018df..61e1d6a1b1 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -991,7 +991,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Fire this out on a different thread so that we don't hold up outgoing packet processing for // everybody else if this is being called due to an ack timeout. // This is the same as processing as the async process of a logout request. - Util.FireAndForget(o => DeactivateClientDueToTimeout(client, timeoutTicks)); + Util.FireAndForget( + o => DeactivateClientDueToTimeout(client, timeoutTicks), null, "LLUDPServer.DeactivateClientDueToTimeout"); return; } @@ -1225,7 +1226,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // buffer. object[] array = new object[] { new IPEndPoint(endPoint.Address, endPoint.Port), packet }; - Util.FireAndForget(HandleUseCircuitCode, array); + Util.FireAndForget(HandleUseCircuitCode, array, "LLUDPServer.HandleUseCircuitCode"); return; } @@ -1238,7 +1239,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP // buffer. object[] array = new object[] { new IPEndPoint(endPoint.Address, endPoint.Port), packet }; - Util.FireAndForget(HandleCompleteMovementIntoRegion, array); + Util.FireAndForget( + HandleCompleteMovementIntoRegion, array, "LLUDPServer.HandleCompleteMovementIntoRegion"); return; } diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs index 5cdcab9f35..47dcbcd3ff 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs @@ -167,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender // Do Decode! if (decode) - Util.FireAndForget(delegate { Decode(assetID, j2kData); }); + Util.FireAndForget(delegate { Decode(assetID, j2kData); }, null, "J2KDecoderModule.BeginDecode"); } } diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 9d6870f1b5..5eca0250a0 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -302,7 +302,7 @@ namespace OpenSim.Region.CoreModules.Asset } Util.FireAndForget( - delegate { WriteFileCache(filename, asset); }); + delegate { WriteFileCache(filename, asset); }, null, "FlotsamAssetCache.UpdateFileCache"); } } catch (Exception e) diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index d8c159f518..ea7481db72 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -593,7 +593,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory if (sendTime < now) { - Util.FireAndForget(o => SendAppearance(avatarID)); + Util.FireAndForget(o => SendAppearance(avatarID), null, "AvatarFactoryModule.SendAppearance"); m_sendqueue.Remove(avatarID); } } @@ -611,7 +611,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory if (sendTime < now) { - Util.FireAndForget(o => SaveAppearance(avatarID)); + Util.FireAndForget(o => SaveAppearance(avatarID), null, "AvatarFactoryModule.SaveAppearance"); m_savequeue.Remove(avatarID); } } @@ -1038,7 +1038,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory client.SendWearables(sp.Appearance.Wearables, sp.Appearance.Serial++); else m_log.WarnFormat("[AVFACTORY]: Client_OnRequestWearables unable to find presence for {0}", client.AgentId); - }); + }, null, "AvatarFactoryModule.OnClientRequestWearables"); } /// diff --git a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs index 5725d67617..5e35135c5f 100644 --- a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs @@ -187,7 +187,7 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures { rc.Request(reqStream, m_Auth); m_log.DebugFormat("[XBakes]: stored {0} textures for user {1}", data.Length, agentId); - } + }, null, "XBakesModule.Store" ); } } diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 31bcdedebd..7ab568e8e5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -511,7 +511,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends // Notify about this user status StatusNotify(friendList, agentID, online); - } + }, null, "FriendsModule.StatusChange" ); } } diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index be129359c5..27b737632c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs @@ -660,7 +660,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends FriendsService.Delete(friendUUI, agentID.ToString()); // notify the exfriend's service - Util.FireAndForget(delegate { Delete(exfriendID, agentID, friendUUI); }); + Util.FireAndForget( + delegate { Delete(exfriendID, agentID, friendUUI); }, null, "HGFriendsModule.DeleteFriendshipForeignFriend"); m_log.DebugFormat("[HGFRIENDS MODULE]: {0} terminated {1}", agentID, friendUUI); return true; @@ -678,7 +679,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends FriendsService.Delete(agentUUI, exfriendID.ToString()); // notify the agent's service? - Util.FireAndForget(delegate { Delete(agentID, exfriendID, agentUUI); }); + Util.FireAndForget( + delegate { Delete(agentID, exfriendID, agentUUI); }, null, "HGFriendsModule.DeleteFriendshipLocalFriend"); m_log.DebugFormat("[HGFRIENDS MODULE]: {0} terminated {1}", agentUUI, exfriendID); return true; diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs index 6f3c80a260..a1b918a3b6 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs @@ -213,7 +213,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage HandleUndeliverableMessage(im, result); else result(success); - }); + }, null, "HGMessageTransferModule.SendInstantMessage"); return; } diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index c1795f6ef3..546a121c3b 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs @@ -194,7 +194,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles Util.FireAndForget(delegate { GetImageAssets(((IScenePresence)obj).UUID); - }); + }, null, "UserProfileModule.GetImageAssets"); } /// diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 0c0cdf21d9..72d6bac840 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs @@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer AgentCircuitData aCircuit = Scene.AuthenticateHandler.GetAgentCircuitData(so.AttachedAvatar); if (aCircuit != null && (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0) { - if (aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) + if (aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServRezerURI")) { string url = aCircuit.ServiceURLs["AssetServerURI"].ToString(); m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Incoming attachment {0} for HG user {1} with asset server {2}", so.Name, so.AttachedAvatar, url); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index 7695404c76..7fcfc748db 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs @@ -295,7 +295,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset if (asset != null) { - Util.FireAndForget(delegate { handler(id, sender, asset); }); + Util.FireAndForget(delegate { handler(id, sender, asset); }, null, "HGAssetBroker.GotFromCache"); return true; } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs index 97b7559ed7..5f3445068b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs @@ -236,7 +236,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset if (asset != null) { - Util.FireAndForget(delegate { handler(id, sender, asset); }); + Util.FireAndForget( + o => handler(id, sender, asset), null, "LocalAssetServiceConnector.GotFromCacheCallback"); return true; } } @@ -249,7 +250,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset // if (null == a) // m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not asynchronously find asset with id {0}", id); - Util.FireAndForget(delegate { handler(assetID, s, a); }); + Util.FireAndForget( + o => handler(assetID, s, a), null, "LocalAssetServiceConnector.GotFromServiceCallback"); }); } diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index bfa3b9ae99..9db5309624 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -226,7 +226,10 @@ namespace OpenSim.Region.Framework.Scenes // We must take a copy here since handle is acts like a reference when used in an iterator. // This leads to race conditions if directly passed to SendCloseChildAgent with more than one neighbour region. ulong handleCopy = handle; - Util.FireAndForget((o) => { SendCloseChildAgent(agentID, handleCopy, auth_code); }); + Util.FireAndForget( + o => SendCloseChildAgent(agentID, handleCopy, auth_code), + null, + "SceneCommunicationService.SendCloseChildAgentConnections"); } } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 9481f716b6..1d234e23a8 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1235,7 +1235,8 @@ namespace OpenSim.Region.Framework.Scenes string.Format("Rez attachments for {0} in {1}", Name, Scene.Name), null); else - Util.FireAndForget(o => Scene.AttachmentsModule.RezAttachments(this)); + Util.FireAndForget( + o => Scene.AttachmentsModule.RezAttachments(this), null, "ScenePresence.RezAttachmentsOnLogin"); } } else @@ -1338,7 +1339,7 @@ namespace OpenSim.Region.Framework.Scenes UseFakeGroupTitle = false; SendAvatarDataToAllClients(false); - }); + }, null, "Scenepresence.ForceViewersUpdateName"); } public int GetStateSource() @@ -3645,7 +3646,8 @@ namespace OpenSim.Region.Framework.Scenes agentpos.CopyFrom(cadu, ControllingClient.SessionId); // Let's get this out of the update loop - Util.FireAndForget(delegate { m_scene.SendOutChildAgentUpdates(agentpos, this); }); + Util.FireAndForget( + o => m_scene.SendOutChildAgentUpdates(agentpos, this), null, "ScenePresence.SendOutChildAgentUpdates"); } } @@ -4515,7 +4517,7 @@ namespace OpenSim.Region.Framework.Scenes } } } - }); + }, null, "ScenePresence.SendScriptEventToAttachments"); } /// diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs index a6c12fd670..b69676b12e 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs @@ -323,7 +323,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore public UUID JsonRezAtRoot(UUID hostID, UUID scriptID, string item, Vector3 pos, Vector3 vel, Quaternion rot, string param) { UUID reqID = UUID.Random(); - Util.FireAndForget(o => DoJsonRezObject(hostID, scriptID, reqID, item, pos, vel, rot, param)); + Util.FireAndForget( + o => DoJsonRezObject(hostID, scriptID, reqID, item, pos, vel, rot, param), null, "JsonStoreScriptModule.DoJsonRezObject"); return reqID; } @@ -336,7 +337,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore public UUID JsonReadNotecard(UUID hostID, UUID scriptID, UUID storeID, string path, string notecardIdentifier) { UUID reqID = UUID.Random(); - Util.FireAndForget(o => DoJsonReadNotecard(reqID, hostID, scriptID, storeID, path, notecardIdentifier)); + Util.FireAndForget( + o => DoJsonReadNotecard(reqID, hostID, scriptID, storeID, path, notecardIdentifier), null, "JsonStoreScriptModule.JsonReadNotecard"); return reqID; } @@ -349,7 +351,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore public UUID JsonWriteNotecard(UUID hostID, UUID scriptID, UUID storeID, string path, string name) { UUID reqID = UUID.Random(); - Util.FireAndForget(delegate(object o) { DoJsonWriteNotecard(reqID,hostID,scriptID,storeID,path,name); }); + Util.FireAndForget( + o => DoJsonWriteNotecard(reqID,hostID,scriptID,storeID,path,name), null, "JsonStoreScriptModule.DoJsonWriteNotecard"); return reqID; } @@ -464,7 +467,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore public UUID JsonTakeValue(UUID hostID, UUID scriptID, UUID storeID, string path) { UUID reqID = UUID.Random(); - Util.FireAndForget(delegate(object o) { DoJsonTakeValue(scriptID,reqID,storeID,path,false); }); + Util.FireAndForget( + o => DoJsonTakeValue(scriptID,reqID,storeID,path,false), null, "JsonStoreScriptModule.DoJsonTakeValue"); return reqID; } @@ -472,7 +476,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore public UUID JsonTakeValueJson(UUID hostID, UUID scriptID, UUID storeID, string path) { UUID reqID = UUID.Random(); - Util.FireAndForget(delegate(object o) { DoJsonTakeValue(scriptID,reqID,storeID,path,true); }); + Util.FireAndForget( + o => DoJsonTakeValue(scriptID,reqID,storeID,path,true), null, "JsonStoreScriptModule.DoJsonTakeValueJson"); return reqID; } @@ -485,7 +490,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore public UUID JsonReadValue(UUID hostID, UUID scriptID, UUID storeID, string path) { UUID reqID = UUID.Random(); - Util.FireAndForget(delegate(object o) { DoJsonReadValue(scriptID,reqID,storeID,path,false); }); + Util.FireAndForget( + o => DoJsonReadValue(scriptID,reqID,storeID,path,false), null, "JsonStoreScriptModule.DoJsonReadValue"); return reqID; } @@ -493,7 +499,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore public UUID JsonReadValueJson(UUID hostID, UUID scriptID, UUID storeID, string path) { UUID reqID = UUID.Random(); - Util.FireAndForget(delegate(object o) { DoJsonReadValue(scriptID,reqID,storeID,path,true); }); + Util.FireAndForget( + o => DoJsonReadValue(scriptID,reqID,storeID,path,true), null, "JsonStoreScriptModule.DoJsonReadValueJson"); return reqID; } diff --git a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs index 6e0a80abaf..d37369c4c4 100644 --- a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs +++ b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs @@ -294,7 +294,8 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport for (int i = 0 ; i < selection.Count ; i++) sel.Add(selection[i].AsUInteger()); - Util.FireAndForget(x => { m_module.HandleMenuSelection(action, m_agentID, sel); }); + Util.FireAndForget( + x => { m_module.HandleMenuSelection(action, m_agentID, sel); }, null, "DynamicMenuModule.HandleMenuSelection"); Encoding encoding = Encoding.UTF8; return encoding.GetBytes(OSDParser.SerializeLLSDXmlString(new OSD())); diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index e347fdc015..f5a25d68cb 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -3343,7 +3343,7 @@ Console.WriteLine(" JointCreateFixed"); RequestAssetDelegate assetProvider = _parent_scene.RequestAssetMethod; if (assetProvider != null) assetProvider(_pbs.SculptTexture, MeshAssetReceived); - }); + }, null, "ODEPrim.CheckMeshAsset"); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index e7ba7a4f1e..97e3eeb170 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2979,7 +2979,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api money.ObjectGiveMoney( m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount); - }); + }, null, "LSL_Api.llGiveMoney"); } public void llMakeExplosion(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset) @@ -3075,7 +3075,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) } - }); + }, null, "LSL_Api.llRezAtRoot"); //ScriptSleep((int)((groupmass * velmag) / 10)); ScriptSleep(100); @@ -3270,7 +3270,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public void DetachFromAvatar() { - Util.FireAndForget(DetachWrapper, m_host); + Util.FireAndForget(DetachWrapper, m_host, "LSL_Api.DetachFromAvatar"); } private void DetachWrapper(object o) @@ -12421,7 +12421,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api new LSL_String(replydata) }, new DetectParams[0])); } - }); + }, null, "LSL_Api.llTransferLindenDollars"); return txn.ToString(); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 704ff15037..10ddf14089 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -790,9 +790,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // We will launch the teleport on a new thread so that when the script threads are terminated // before teleport in ScriptInstance.GetXMLState(), we don't end up aborting the one doing the teleporting. - Util.FireAndForget(o => World.RequestTeleportLocation( - presence.ControllingClient, regionName, position, - lookat, (uint)TPFlags.ViaLocation)); + Util.FireAndForget( + o => World.RequestTeleportLocation( + presence.ControllingClient, regionName, position, + lookat, (uint)TPFlags.ViaLocation), + null, "OSSL_Api.TeleportAgentByRegionCoords"); ScriptSleep(5000); @@ -836,9 +838,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // We will launch the teleport on a new thread so that when the script threads are terminated // before teleport in ScriptInstance.GetXMLState(), we don't end up aborting the one doing the teleporting. - Util.FireAndForget(o => World.RequestTeleportLocation( - presence.ControllingClient, regionHandle, - position, lookat, (uint)TPFlags.ViaLocation)); + Util.FireAndForget( + o => World.RequestTeleportLocation( + presence.ControllingClient, regionHandle, + position, lookat, (uint)TPFlags.ViaLocation), + null, "OSSL_Api.TeleportAgentByRegionName"); ScriptSleep(5000); diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index da2bfebd8d..81c9df284e 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -182,7 +182,8 @@ namespace OpenSim.Server.Handlers.Simulation if (action.Equals("release")) ReleaseAgent(regionID, id); else - Util.FireAndForget(delegate { m_SimulationService.CloseAgent(destination, id, auth_token); }); + Util.FireAndForget( + o => m_SimulationService.CloseAgent(destination, id, auth_token), null, "AgentHandler.DoAgentDelete"); responsedata["int_response_code"] = HttpStatusCode.OK; responsedata["str_response_string"] = "OpenSim agent " + id.ToString(); diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs index 95e4bab134..cd4781deb0 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs @@ -69,7 +69,7 @@ namespace OpenSim.Services.Connectors.SimianGrid Util.FireAndForget(delegate(object o) { m_GridUserService.SetLastPosition(sp.UUID.ToString(), sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); - }); + }, null, "SimianActivityDetector.SetLastPositionOnMakeRootAgent"); } public void OnNewClient(IClientAPI client) @@ -94,7 +94,7 @@ namespace OpenSim.Services.Connectors.SimianGrid Util.FireAndForget(delegate(object o) { m_GridUserService.SetLastPosition(sp.UUID.ToString(), sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); - }); + }, null, "SimianActivityDetector.SetLastPositionOnEnteringNewParcel"); } } } \ No newline at end of file diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 01cbf91e3e..9ad4a7a56f 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs @@ -225,7 +225,7 @@ namespace OpenSim.Services.Connectors.SimianGrid { AssetBase asset = SimianGetOperation(id); handler(id, sender, asset); - } + }, null, "SimianAssetServiceConnector.GetFromService" ); return true; diff --git a/OpenSim/Services/HypergridService/HGFriendsService.cs b/OpenSim/Services/HypergridService/HGFriendsService.cs index a8bcfb2fa8..6e35a88712 100644 --- a/OpenSim/Services/HypergridService/HGFriendsService.cs +++ b/OpenSim/Services/HypergridService/HGFriendsService.cs @@ -198,7 +198,8 @@ namespace OpenSim.Services.HypergridService // So let's send back the call, but start a thread to continue // with the verification and the actual action. - Util.FireAndForget(delegate { ProcessFriendshipOffered(fromID, fromName, toID, message); }); + Util.FireAndForget( + o => ProcessFriendshipOffered(fromID, fromName, toID, message), null, "HGFriendsService.ProcessFriendshipOffered"); return true; } diff --git a/OpenSim/Services/MapImageService/MapImageService.cs b/OpenSim/Services/MapImageService/MapImageService.cs index c07e034c95..a816411cc9 100644 --- a/OpenSim/Services/MapImageService/MapImageService.cs +++ b/OpenSim/Services/MapImageService/MapImageService.cs @@ -166,7 +166,8 @@ namespace OpenSim.Services.MapImageService // m_log.DebugFormat("{0} UpdateMultiResolutionFilesAsync: scheduling update for <{1},{2}>", LogHeader, x, y); multiRezToBuild.Enqueue(new mapToMultiRez(x, y)); if (multiRezToBuild.Count == 1) - Util.FireAndForget(DoUpdateMultiResolutionFilesAsync); + Util.FireAndForget( + DoUpdateMultiResolutionFilesAsync, null, "MapImageService.DoUpdateMultiResolutionFilesAsync"); } return true; diff --git a/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs b/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs index 9b3cc93c50..0ab407e224 100644 --- a/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs +++ b/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs @@ -78,7 +78,7 @@ namespace OpenSim.Tests.Stress Drawer d = new Drawer(this, i); drawers.Add(d); Console.WriteLine("Starting drawer {0}", i); - Util.FireAndForget(o => d.Draw()); + Util.FireAndForget(o => d.Draw(), null, "VectorRenderModuleStressTests.TestConcurrentRepeatedDraw"); } Thread.Sleep(10 * 60 * 1000);