From 8568503921940bf42f8b03e1ccc62fbabbb5152f Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 4 Sep 2013 23:48:24 +0100 Subject: [PATCH] Stop "show client stats" from throwing an exception if somehow Scene.m_clientManager still retains a reference to a dead client. Instead, "show client stats" now prints "Off!" so that exception is not thrown and we know which entries in ClientManager are in this state. There's a race condition which could trigger this, but the window is extremely short and exceptions would not be thrown consistently (which is the behaviour observed). It should otherwise be impossible for this condition to occur, so there may be a weakness in client manager IClientAPI removal. --- .../Agent/UDP/Linden/LindenUDPInfoModule.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs index 15dea1742d..1eb0a6bc5f 100644 --- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs @@ -624,9 +624,16 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden int avg_reqs = cinfo.AsyncRequests.Values.Sum() + cinfo.GenericRequests.Values.Sum() + cinfo.SyncRequests.Values.Sum(); avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1); + string childAgentStatus; + + if (llClient.SceneAgent != null) + childAgentStatus = llClient.SceneAgent.IsChildAgent ? "N" : "Y"; + else + childAgentStatus = "Off!"; + m_log.InfoFormat("[INFO]: {0,-12} {1,-20} {2,-6} {3,-11} {4,-11} {5,-16}", scene.RegionInfo.RegionName, llClient.Name, - llClient.SceneAgent.IsChildAgent ? "N" : "Y", + childAgentStatus, (DateTime.Now - cinfo.StartedTime).Minutes, avg_reqs, string.Format(