From c4a3c93097c9a1c1b93f5b86dfc0f17062e42c30 Mon Sep 17 00:00:00 2001 From: Steven Zielinski Date: Fri, 1 May 2015 17:07:19 -0400 Subject: [PATCH 1/3] Fixed a bug that would cause the sim extra stats reporter to fail in reporting stats. The bug was caused by the current process threads which can return null references. Test Plan: Tested on windows using opensim standalone and the json stats. Reviewers: rlouden, kboswell, clattin, martin, ssirigam Differential Revision: http://cr.irl.ucf.edu/D277 --- OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs index 432efdbd06..83d9e85cb4 100755 --- a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs @@ -433,7 +433,11 @@ Asset service request failures: {3}" + Environment.NewLine, foreach (ProcessThread currentThread in Process.GetCurrentProcess().Threads) { - if (currentThread.ThreadState == ThreadState.Running) + // A known issue with the current process .threads method is + // that it can return null threads, thus don't count those as + // running threads and prevent the program function from failing + if (currentThread != null && + currentThread.ThreadState == ThreadState.Running) { numberThreadsRunning++; } From cb517839e9e258d154e17fe85e97f1462b06536a Mon Sep 17 00:00:00 2001 From: Steven Zielinski Date: Mon, 4 May 2015 10:05:36 -0400 Subject: [PATCH 2/3] Fixed vocabulary in a comment to match the code. --- OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs index 83d9e85cb4..3791fff1c0 100755 --- a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs @@ -433,7 +433,7 @@ Asset service request failures: {3}" + Environment.NewLine, foreach (ProcessThread currentThread in Process.GetCurrentProcess().Threads) { - // A known issue with the current process .threads method is + // A known issue with the current process .threads property is // that it can return null threads, thus don't count those as // running threads and prevent the program function from failing if (currentThread != null && From 96a86e7d5a4a4f0d712522190a1ff19fc44aac80 Mon Sep 17 00:00:00 2001 From: Steven Zielinski Date: Mon, 4 May 2015 10:40:36 -0400 Subject: [PATCH 3/3] Fixed a bug that would cause the sim extra stats reporter to fail in reporting stats. The bug was caused by the current process threads which can return null references. Test Plan: Tested on windows using opensim standalone and the json stats. Reviewers: rlouden, ssirigam, clattin, martin, kboswell Reviewed By: rlouden, ssirigam, clattin, martin, kboswell Differential Revision: http://cr.irl.ucf.edu/D277 --- OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs index 3791fff1c0..e4df7ee7f0 100755 --- a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs @@ -433,7 +433,7 @@ Asset service request failures: {3}" + Environment.NewLine, foreach (ProcessThread currentThread in Process.GetCurrentProcess().Threads) { - // A known issue with the current process .threads property is + // A known issue with the current process .Threads property is // that it can return null threads, thus don't count those as // running threads and prevent the program function from failing if (currentThread != null &&