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.
0.7.6-extended
Justin Clark-Casey (justincc) 2013-09-04 23:48:24 +01:00
parent 6f1ff47fee
commit 8568503921
1 changed files with 8 additions and 1 deletions

View File

@ -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(