MantisBT - opensim
View Issue Details
0007566opensim[GRID] Grid Servicepublic2015-05-13 11:122016-05-13 18:29
nebadon 
 
normalblockalways
newopen 
master (dev code) 
master (dev code) 
Standalone (1 Region) , Standalone (Multiple Regions) , Grid (1 Region per Sim) , Grid (Multiple Regions per Sim)
BasicPhysics
Mono / Linux32, Mono / Linux64
4.0
0007566: DNS Caching in Mono
There seems to be some issues with people who run simulators on DHCP connections who use FQDN. If you teleport to or from one of those regions, the region IP address is cached on the other end (not the DHCP region) and when the DHCP region IP address eventually changes, Robust and other regions keep the old IP address cached in memory eternally and you can not log directly in or teleport from any region you had visited previously using old IP address, only when the robust service and other regions are restarted can this region be reached again. It does appear though that you can teleport from a region that has never been visited from this region and once you do this it does some how update will robust and direct log in becomes available again until the next IP change. There was some discussion previously on this topic noted below :
http://opensim-dev.2196679.n2.nabble.com/DNS-lookup-and-caching-td7579882.html [^]
http://stackoverflow.com/questions/21073103/resetting-dns-cache-in-c-sharp-mono [^]

http://stackoverflow.com/questions/7277582/how-do-i-clear-system-net-client-dns-cache [^]

No tags attached.
? TestDNS.cs (1,556) 2015-07-23 04:28
http://opensimulator.org/mantis/file_download.php?file_id=4323&type=bug
Issue History
2015-05-13 11:12nebadonNew Issue
2015-05-13 11:13nebadonDescription Updatedbug_revision_view_page.php?rev_id=4157#r4157
2015-05-13 11:16nebadonDescription Updatedbug_revision_view_page.php?rev_id=4158#r4158
2015-05-13 11:18nebadonAdditional Information Updatedbug_revision_view_page.php?rev_id=4160#r4160
2015-05-13 14:32nebadonNote Added: 0028369
2015-05-17 11:51FreakyTechNote Added: 0028392
2015-07-23 04:27orenhNote Added: 0028955
2015-07-23 04:28orenhFile Added: TestDNS.cs
2015-07-23 04:29orenhNote Edited: 0028955bug_revision_view_page.php?bugnote_id=28955#r4529
2015-08-03 10:37FreakyTechNote Added: 0029084
2016-05-13 18:29smxyNote Added: 0030312

Notes
(0028369)
nebadon   
2015-05-13 14:32   
I imagine this could have some impact eventually on developing some kind of fail over or load balancing system as well where you are constantly shifting nodes around between different virtual machines or containers.
(0028392)
FreakyTech   
2015-05-17 11:51   
I have tracked down a few sim crashes to exactly that problem of caching DNS entries forever within Mono.

The actual caching logic is in ServicePointManager within the System.Web namespace.

Especially with dynamic DNS entries, it tends to cache DNS lookups as long as the OpenSim instance is running. This fails all kinds of inter-sim communication.

It also affects the Grid server since Robust is also caching DNS entries due to that issue when running on Mono.
(0028955)
orenh   
2015-07-23 04:27   
(edited on: 2015-07-23 04:29)
I can confirm that Mono *doesn't* cache DNS entries. I wrote a test program that performs a lookup for a certain hostname in an endless loop. This is a hostname under my control, with a low TTL (60 seconds). Then I changed the hostname's IP, and waited to see if the (running) Mono program will pick it up. It always did, usually within a minute (it took 90 seconds once).

Tested with:

Mono 3.10.0 (Amazon Linux)
Mono 3.2.8 (Ubuntu 14)
Mono 4.0.2 (Ubuntu 14)

By the way, I also tested in Windows (with .NET), and it didn't cache the DNS result either.

Both of the Linux computers I tested on were using a default installation (I used the default AMI's that Amazon EC2 provides).

The program is in the attached file "TestDNS.cs", in case anyone wants to replicate these tests.

(0029084)
FreakyTech   
2015-08-03 10:37   
The Test program does not prove anything. Since the caching is not happening with Dns.GetHostEntry(hostname).

It is in the ServicePointManager which gets used by WebRequest which is used for all HTTP Client requests in OpenSim.

So, you tested actually the wrong part.
(0030312)
smxy   
2016-05-13 18:29   
Oren, recently, my grid's IP address changed and no Kitely avatar was able to get to my grid, until Ilan had Kitely's Robust restarted and the problem went away immediately. So it sure seemed like Kitely was caching my old address somehow.