diff options
author | Melanie | 2011-07-25 04:16:53 +0200 |
---|---|---|
committer | Melanie | 2011-07-25 04:16:53 +0200 |
commit | 5c012cac54f92f2881005a50fd3eb103f0f2ea07 (patch) | |
tree | 854af8d5196b954b7b731e07439c328fa44e5a0c | |
parent | Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/ca... (diff) | |
download | opensim-SC-5c012cac54f92f2881005a50fd3eb103f0f2ea07.zip opensim-SC-5c012cac54f92f2881005a50fd3eb103f0f2ea07.tar.gz opensim-SC-5c012cac54f92f2881005a50fd3eb103f0f2ea07.tar.bz2 opensim-SC-5c012cac54f92f2881005a50fd3eb103f0f2ea07.tar.xz |
Add a timer to monitor the heartbeat. Restart it if it's been dead for
5 seconds.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 18 |
2 files changed, 17 insertions, 2 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 04a68ae..dbfd0f2 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -487,6 +487,7 @@ namespace OpenSim | |||
487 | } | 487 | } |
488 | 488 | ||
489 | scene.StartTimer(); | 489 | scene.StartTimer(); |
490 | scene.StartTimerWatchdog(); | ||
490 | 491 | ||
491 | return clientServer; | 492 | return clientServer; |
492 | } | 493 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e02a866..ec82cc3 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -109,6 +109,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
109 | 109 | ||
110 | protected int m_splitRegionID; | 110 | protected int m_splitRegionID; |
111 | protected Timer m_restartWaitTimer = new Timer(); | 111 | protected Timer m_restartWaitTimer = new Timer(); |
112 | protected Timer m_timerWatchdog = new Timer(); | ||
112 | protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>(); | 113 | protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>(); |
113 | protected List<RegionInfo> m_neighbours = new List<RegionInfo>(); | 114 | protected List<RegionInfo> m_neighbours = new List<RegionInfo>(); |
114 | protected string m_simulatorVersion = "OpenSimulator Server"; | 115 | protected string m_simulatorVersion = "OpenSimulator Server"; |
@@ -191,7 +192,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
191 | private bool m_scripts_enabled = true; | 192 | private bool m_scripts_enabled = true; |
192 | private string m_defaultScriptEngine; | 193 | private string m_defaultScriptEngine; |
193 | private int m_LastLogin; | 194 | private int m_LastLogin; |
194 | private Thread HeartbeatThread; | 195 | private Thread HeartbeatThread = null; |
195 | private volatile bool shuttingdown; | 196 | private volatile bool shuttingdown; |
196 | 197 | ||
197 | private int m_lastUpdate; | 198 | private int m_lastUpdate; |
@@ -4886,7 +4887,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4886 | if (m_firstHeartbeat) | 4887 | if (m_firstHeartbeat) |
4887 | return; | 4888 | return; |
4888 | 4889 | ||
4889 | if (Util.EnvironmentTickCountSubtract(m_lastUpdate) > 10000) | 4890 | if (Util.EnvironmentTickCountSubtract(m_lastUpdate) > 5000) |
4890 | StartTimer(); | 4891 | StartTimer(); |
4891 | } | 4892 | } |
4892 | 4893 | ||
@@ -5380,5 +5381,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
5380 | reason = String.Empty; | 5381 | reason = String.Empty; |
5381 | return true; | 5382 | return true; |
5382 | } | 5383 | } |
5384 | |||
5385 | public void StartTimerWatchdog() | ||
5386 | { | ||
5387 | m_timerWatchdog.Interval = 1000; | ||
5388 | m_timerWatchdog.Elapsed += TimerWatchdog; | ||
5389 | m_timerWatchdog.AutoReset = true; | ||
5390 | m_timerWatchdog.Start(); | ||
5391 | } | ||
5392 | |||
5393 | public void TimerWatchdog(object sender, ElapsedEventArgs e) | ||
5394 | { | ||
5395 | CheckHeartbeat(); | ||
5396 | } | ||
5383 | } | 5397 | } |
5384 | } | 5398 | } |