When reporting a thread timeout, create a copy of the info rather than passing the original ThreadWatchdogInfo structure.
This is to avoid the possibility of misleading reporting if a watchdog update outraces an alarm. Should address any remaining issues from http://opensimulator.org/mantis/view.php?id=60120.7.4.1
parent
cab546ecee
commit
7399d3e953
|
@ -89,6 +89,17 @@ namespace OpenSim.Framework.Monitoring
|
||||||
FirstTick = Environment.TickCount & Int32.MaxValue;
|
FirstTick = Environment.TickCount & Int32.MaxValue;
|
||||||
LastTick = FirstTick;
|
LastTick = FirstTick;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ThreadWatchdogInfo(ThreadWatchdogInfo previousTwi)
|
||||||
|
{
|
||||||
|
Thread = previousTwi.Thread;
|
||||||
|
FirstTick = previousTwi.FirstTick;
|
||||||
|
LastTick = previousTwi.LastTick;
|
||||||
|
Timeout = previousTwi.Timeout;
|
||||||
|
IsTimedOut = previousTwi.IsTimedOut;
|
||||||
|
AlarmIfTimeout = previousTwi.AlarmIfTimeout;
|
||||||
|
AlarmMethod = previousTwi.AlarmMethod;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -335,7 +346,9 @@ namespace OpenSim.Framework.Monitoring
|
||||||
if (callbackInfos == null)
|
if (callbackInfos == null)
|
||||||
callbackInfos = new List<ThreadWatchdogInfo>();
|
callbackInfos = new List<ThreadWatchdogInfo>();
|
||||||
|
|
||||||
callbackInfos.Add(threadInfo);
|
// Send a copy of the watchdog info to prevent race conditions where the watchdog
|
||||||
|
// thread updates the monitoring info after an alarm has been sent out.
|
||||||
|
callbackInfos.Add(new ThreadWatchdogInfo(threadInfo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue