From 008c6a4610fa7b710a9e2546cc09d9fee57e5795 Mon Sep 17 00:00:00 2001 From: Talun Date: Fri, 1 Jun 2012 00:39:26 +0100 Subject: [PATCH 1/3] Mantis 4597 AgentPaused packet is ignored. The packet was actually being handled but not acted on. This change extends the default timeout for paused clients to 5 minutes and makes both the paused and non-paused timeout periods configurable. --- .../ClientStack/Linden/UDP/LLUDPServer.cs | 18 +++++++++++++++--- bin/OpenSimDefaults.ini | 13 +++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index edf91cb685..32ba590718 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -155,7 +155,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP private int m_defaultRTO = 0; private int m_maxRTO = 0; - + private int m_ackTimeout = 0; + private int m_pausedAckTimeout = 0; private bool m_disableFacelights = false; public Socket Server { get { return null; } } @@ -198,11 +199,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_defaultRTO = config.GetInt("DefaultRTO", 0); m_maxRTO = config.GetInt("MaxRTO", 0); m_disableFacelights = config.GetBoolean("DisableFacelights", false); + m_ackTimeout = 1000 * config.GetInt("AckTimeout", 60); + m_pausedAckTimeout = 1000 * config.GetInt("PausedAckTimeout", 300); } else { PrimUpdatesPerCallback = 100; TextureSendLimit = 20; + m_ackTimeout = 1000 * 60; // 1 minute + m_pausedAckTimeout = 1000 * 300; // 5 minutes } #region BinaryStats @@ -491,8 +496,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP return; // Disconnect an agent if no packets are received for some time - //FIXME: Make 60 an .ini setting - if ((Environment.TickCount & Int32.MaxValue) - udpClient.TickLastPacketReceived > 1000 * 60) + int timeoutTicks = m_ackTimeout; + + // Allow more slack if the client is "paused" eg file upload dialogue is open + // Some sort of limit is needed in case the client crashes, loses its network connection + // or some other disaster prevents it from sendung the AgentResume + if (udpClient.IsPaused) + timeoutTicks = m_pausedAckTimeout; + + if ((Environment.TickCount & Int32.MaxValue) - udpClient.TickLastPacketReceived > timeoutTicks) { m_log.Warn("[LLUDPSERVER]: Ack timeout, disconnecting " + udpClient.AgentID); StatsManager.SimExtraStats.AddAbnormalClientThreadTermination(); diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 27d86e8f8c..c67e45a0ff 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -536,6 +536,19 @@ ; ;DisableFacelights = false + ; The time to wait before disconecting an unresponsive client. + ; The time is in seconds. The default is one minute + ; + ;AckTimeout = 60 + + ; The time to wait before disconecting an unresponsive paused client. + ; A client can be paused when the file selection dialog is open during file upload. + ; This gives extra time to find files via the dialog but will still disconnect if + ; the client crashes or loses its network connection + ; The time is in seconds. The default is five minutes. + ; + ;PausedAckTimeout = 300 + [ClientStack.LindenCaps] ;; Long list of capabilities taken from ;; http://wiki.secondlife.com/wiki/Current_Sim_Capabilities From 42179578fc5292d9bd12aeccc45948d908c42d1a Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 5 Jun 2012 01:33:58 +0100 Subject: [PATCH 2/3] Allow fix-phantoms command to appear even if CombineContiguousRegions = false, since this allows one to go back from a megaregion to normal regions. Adapted from a patch by Garmin Kawaguichi in http://opensimulator.org/mantis/view.php?id=6027 Garmin says that fix-phantoms allows one to reset objects when going back from megaregion to normal regions as well as the othe rway around. Thanks! --- .../RegionCombinerModule.cs | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index 40daf1343c..355502863c 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs @@ -61,7 +61,7 @@ namespace OpenSim.Region.RegionCombinerModule /// /// Is this module enabled? /// - private bool enabledYN = false; + private bool m_combineContiguousRegions = false; /// /// This holds the root regions for the megaregions. @@ -79,14 +79,12 @@ namespace OpenSim.Region.RegionCombinerModule public void Initialise(IConfigSource source) { IConfig myConfig = source.Configs["Startup"]; - enabledYN = myConfig.GetBoolean("CombineContiguousRegions", false); + m_combineContiguousRegions = myConfig.GetBoolean("CombineContiguousRegions", false); - if (enabledYN) - { - MainConsole.Instance.Commands.AddCommand( - "RegionCombinerModule", false, "fix-phantoms", "fix-phantoms", - "Fixes phantom objects after an import to megaregions", FixPhantoms); - } + MainConsole.Instance.Commands.AddCommand( + "RegionCombinerModule", false, "fix-phantoms", "fix-phantoms", + "Fixes phantom objects after an import to a megaregion or a change from a megaregion back to normal regions", + FixPhantoms); } public void Close() @@ -95,7 +93,7 @@ namespace OpenSim.Region.RegionCombinerModule public void AddRegion(Scene scene) { - if (enabledYN) + if (m_combineContiguousRegions) scene.RegisterModuleInterface(this); } @@ -105,7 +103,10 @@ namespace OpenSim.Region.RegionCombinerModule public void RegionLoaded(Scene scene) { - if (enabledYN) + lock (m_startingScenes) + m_startingScenes.Add(scene.RegionInfo.originRegionID, scene); + + if (m_combineContiguousRegions) { RegionLoadedDoWork(scene); @@ -208,7 +209,6 @@ namespace OpenSim.Region.RegionCombinerModule { return; } - } } @@ -220,8 +220,6 @@ namespace OpenSim.Region.RegionCombinerModule return; // */ - lock (m_startingScenes) - m_startingScenes.Add(scene.RegionInfo.originRegionID, scene); // Give each region a standard set of non-infinite borders Border northBorder = new Border(); From a5410c2c19bfef9242d9cfcfc1b4fea67f470fd5 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 5 Jun 2012 01:37:40 +0100 Subject: [PATCH 3/3] minor: Add user feedback when executing fix-phantoms --- OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index 355502863c..204c4ff5fb 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs @@ -1066,6 +1066,8 @@ namespace OpenSim.Region.RegionCombinerModule foreach (Scene s in scenes) { + MainConsole.Instance.OutputFormat("Fixing phantoms for {0}", s.RegionInfo.RegionName); + s.ForEachSOG(so => so.AbsolutePosition = so.AbsolutePosition); } }