Add a timer to monitor the heartbeat. Restart it if it's been dead for
5 seconds.avinationmerge
parent
2e83b48873
commit
5c012cac54
|
@ -487,6 +487,7 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
|
|
||||||
scene.StartTimer();
|
scene.StartTimer();
|
||||||
|
scene.StartTimerWatchdog();
|
||||||
|
|
||||||
return clientServer;
|
return clientServer;
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,6 +109,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
protected int m_splitRegionID;
|
protected int m_splitRegionID;
|
||||||
protected Timer m_restartWaitTimer = new Timer();
|
protected Timer m_restartWaitTimer = new Timer();
|
||||||
|
protected Timer m_timerWatchdog = new Timer();
|
||||||
protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>();
|
protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>();
|
||||||
protected List<RegionInfo> m_neighbours = new List<RegionInfo>();
|
protected List<RegionInfo> m_neighbours = new List<RegionInfo>();
|
||||||
protected string m_simulatorVersion = "OpenSimulator Server";
|
protected string m_simulatorVersion = "OpenSimulator Server";
|
||||||
|
@ -191,7 +192,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
private bool m_scripts_enabled = true;
|
private bool m_scripts_enabled = true;
|
||||||
private string m_defaultScriptEngine;
|
private string m_defaultScriptEngine;
|
||||||
private int m_LastLogin;
|
private int m_LastLogin;
|
||||||
private Thread HeartbeatThread;
|
private Thread HeartbeatThread = null;
|
||||||
private volatile bool shuttingdown;
|
private volatile bool shuttingdown;
|
||||||
|
|
||||||
private int m_lastUpdate;
|
private int m_lastUpdate;
|
||||||
|
@ -4886,7 +4887,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (m_firstHeartbeat)
|
if (m_firstHeartbeat)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Util.EnvironmentTickCountSubtract(m_lastUpdate) > 10000)
|
if (Util.EnvironmentTickCountSubtract(m_lastUpdate) > 5000)
|
||||||
StartTimer();
|
StartTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5380,5 +5381,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
reason = String.Empty;
|
reason = String.Empty;
|
||||||
return true;
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue