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

0.9.0-post-fixes
UbitUmarov 2017-05-29 07:48:09 +01:00
parent a317bba8cf
commit 91caf98308
3 changed files with 9 additions and 5 deletions

View File

@ -991,7 +991,7 @@ namespace OpenSim.Framework
return output.ToString();
}
static ExpiringCache<string,IPAddress> dnscache = new ExpiringCache<string, IPAddress>();
private static ExpiringCache<string,IPAddress> dnscache = new ExpiringCache<string, IPAddress>();
/// <summary>
/// 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;

View File

@ -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;

View File

@ -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);