From 91caf98308e4a5f371f9a25adfb4084ff5bfbc34 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 29 May 2017 07:48:09 +0100 Subject: change servicePoint dns expire also to 5min, let the endpoints expire slide. This should reduce impact of absurd dns fails observed on my test ubuntu VM --- OpenSim/Framework/Util.cs | 8 +++++++- OpenSim/Region/Application/Application.cs | 3 +-- OpenSim/Server/ServerMain.cs | 3 +-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index a3c7750..f52a84c 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -991,7 +991,7 @@ namespace OpenSim.Framework return output.ToString(); } - static ExpiringCache dnscache = new ExpiringCache(); + private static ExpiringCache dnscache = new ExpiringCache(); /// /// Converts a URL to a IPAddress @@ -1015,7 +1015,10 @@ namespace OpenSim.Framework IPAddress ia = null; if(dnscache.TryGetValue(dnsAddress, out ia) && ia != null) + { + dnscache.AddOrUpdate(dnsAddress, ia, 300); return ia; + } ia = null; // If it is already an IP, don't let GetHostEntry see it @@ -1081,7 +1084,10 @@ namespace OpenSim.Framework IPAddress ia = null; if(dnscache.TryGetValue(hostname, out ia) && ia != null) + { + dnscache.AddOrUpdate(hostname, ia, 300); return getEndPoint(ia, port); + } ia = null; diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 447afb4..66ce8e5 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -79,10 +79,9 @@ namespace OpenSim else { ServicePointManager.DefaultConnectionLimit = 12; - try { ServicePointManager.DnsRefreshTimeout = 120000; } // just is case some crazy mono decides to have it infinity - catch { } } + try { ServicePointManager.DnsRefreshTimeout = 300000; } catch { } ServicePointManager.Expect100Continue = false; ServicePointManager.UseNagleAlgorithm = false; diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs index accf938..69d0b74 100644 --- a/OpenSim/Server/ServerMain.cs +++ b/OpenSim/Server/ServerMain.cs @@ -59,8 +59,7 @@ namespace OpenSim.Server ServicePointManager.Expect100Continue = false; ServicePointManager.UseNagleAlgorithm = false; - try { ServicePointManager.DnsRefreshTimeout = 120000; } // just is case some mono decides to have it infinity - catch { } + try { ServicePointManager.DnsRefreshTimeout = 300000; } catch { } m_Server = new HttpServerBase("R.O.B.U.S.T.", args); -- cgit v1.1