Add a timer to monitor the heartbeat. Restart it if it's been dead for

5 seconds.
avinationmerge
Melanie 2011-07-25 04:16:53 +02:00
parent 2e83b48873
commit 5c012cac54
2 changed files with 17 additions and 2 deletions

View File

@ -487,6 +487,7 @@ namespace OpenSim
}
scene.StartTimer();
scene.StartTimerWatchdog();
return clientServer;
}

View File

@ -109,6 +109,7 @@ namespace OpenSim.Region.Framework.Scenes
protected int m_splitRegionID;
protected Timer m_restartWaitTimer = new Timer();
protected Timer m_timerWatchdog = new Timer();
protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>();
protected List<RegionInfo> m_neighbours = new List<RegionInfo>();
protected string m_simulatorVersion = "OpenSimulator Server";
@ -191,7 +192,7 @@ namespace OpenSim.Region.Framework.Scenes
private bool m_scripts_enabled = true;
private string m_defaultScriptEngine;
private int m_LastLogin;
private Thread HeartbeatThread;
private Thread HeartbeatThread = null;
private volatile bool shuttingdown;
private int m_lastUpdate;
@ -4886,7 +4887,7 @@ namespace OpenSim.Region.Framework.Scenes
if (m_firstHeartbeat)
return;
if (Util.EnvironmentTickCountSubtract(m_lastUpdate) > 10000)
if (Util.EnvironmentTickCountSubtract(m_lastUpdate) > 5000)
StartTimer();
}
@ -5380,5 +5381,18 @@ namespace OpenSim.Region.Framework.Scenes
reason = String.Empty;
return true;
}
public void StartTimerWatchdog()
{
m_timerWatchdog.Interval = 1000;
m_timerWatchdog.Elapsed += TimerWatchdog;
m_timerWatchdog.AutoReset = true;
m_timerWatchdog.Start();
}
public void TimerWatchdog(object sender, ElapsedEventArgs e)
{
CheckHeartbeat();
}
}
}