From d90b68c2a637b822b826a0cf3c52991aa9ee2c97 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 26 May 2017 00:05:35 +0100
Subject: change wrong watchdog stopped thread check code, and don't log it
---
OpenSim/Framework/Monitoring/Watchdog.cs | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Framework/Monitoring')
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs
index 8a4894e..5fb725c 100644
--- a/OpenSim/Framework/Monitoring/Watchdog.cs
+++ b/OpenSim/Framework/Monitoring/Watchdog.cs
@@ -193,7 +193,7 @@ namespace OpenSim.Framework.Monitoring
m_watchdogTimer.Dispose();
m_watchdogTimer = null;
}
-
+
foreach(ThreadWatchdogInfo twi in m_threads.Values)
{
Thread t = twi.Thread;
@@ -341,6 +341,8 @@ namespace OpenSim.Framework.Monitoring
///
private static void WatchdogTimerElapsed(object sender, System.Timers.ElapsedEventArgs e)
{
+ if(!m_enabled)
+ return;
int now = Environment.TickCount & Int32.MaxValue;
int msElapsed = now - LastWatchdogThreadTick;
@@ -358,21 +360,26 @@ namespace OpenSim.Framework.Monitoring
List callbackInfos = null;
List threadsToRemove = null;
+ const ThreadState thgone = ThreadState.Stopped | ThreadState.Aborted | ThreadState.AbortRequested;
+
lock (m_threads)
{
foreach(ThreadWatchdogInfo threadInfo in m_threads.Values)
{
- if(threadInfo.Thread.ThreadState == ThreadState.Stopped)
+ if(!m_enabled)
+ return;
+ if(!threadInfo.Thread.IsAlive || (threadInfo.Thread.ThreadState & thgone) != 0)
{
if(threadsToRemove == null)
threadsToRemove = new List();
threadsToRemove.Add(threadInfo);
-
+/*
if(callbackInfos == null)
callbackInfos = new List();
callbackInfos.Add(threadInfo);
+*/
}
else if(!threadInfo.IsTimedOut && now - threadInfo.LastTick >= threadInfo.Timeout)
{
--
cgit v1.1
From 8d8236cfb245eaa25f81f2840175b8fe676febbd Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 26 May 2017 00:34:04 +0100
Subject: missing file change.. actually use watchdog threads on
assetsconnector and avoid null refs on JobEngine
---
OpenSim/Framework/Monitoring/JobEngine.cs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Framework/Monitoring')
diff --git a/OpenSim/Framework/Monitoring/JobEngine.cs b/OpenSim/Framework/Monitoring/JobEngine.cs
index 0a39e4b..a6a059d 100644
--- a/OpenSim/Framework/Monitoring/JobEngine.cs
+++ b/OpenSim/Framework/Monitoring/JobEngine.cs
@@ -136,12 +136,15 @@ namespace OpenSim.Framework.Monitoring
if(m_jobQueue.Count <= 0)
m_cancelSource.Cancel();
- if(m_finishedProcessingAfterStop.WaitOne(RequestProcessTimeoutOnStop))
+ m_finishedProcessingAfterStop.WaitOne(RequestProcessTimeoutOnStop);
m_finishedProcessingAfterStop.Close();
}
finally
{
- m_cancelSource.Dispose();
+ if(m_cancelSource != null)
+ m_cancelSource.Dispose();
+ if(m_finishedProcessingAfterStop != null)
+ m_finishedProcessingAfterStop.Dispose();
}
}
}
--
cgit v1.1