* Catch the occasional resolution exception that comes out of SceneCommunicationService.EnableChildAgents so we can see what hostname is failing

0.6.0-stable
Justin Clarke Casey 2008-03-22 20:44:15 +00:00
parent 6ce79a0f78
commit 61ae75f364
4 changed files with 38 additions and 10 deletions

View File

@ -41,7 +41,15 @@ namespace OpenSim.Framework.Communications
RegionCommsListener RegisterRegion(RegionInfo regionInfos); RegionCommsListener RegisterRegion(RegionInfo regionInfos);
bool DeregisterRegion(RegionInfo regionInfo); bool DeregisterRegion(RegionInfo regionInfo);
/// <summary>
/// Get information about the regions neighbouring the given co-ordinates.
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <returns></returns>
List<SimpleRegionInfo> RequestNeighbours(uint x, uint y); List<SimpleRegionInfo> RequestNeighbours(uint x, uint y);
RegionInfo RequestNeighbourInfo(ulong regionHandle); RegionInfo RequestNeighbourInfo(ulong regionHandle);
RegionInfo RequestClosestRegion(string regionName); RegionInfo RequestClosestRegion(string regionName);
Dictionary<string, string> GetGridSettings(); Dictionary<string, string> GetGridSettings();

View File

@ -38,6 +38,9 @@ namespace OpenSim.Framework
[Serializable] [Serializable]
public class SimpleRegionInfo public class SimpleRegionInfo
{ {
// private static readonly log4net.ILog m_log
// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public SimpleRegionInfo() public SimpleRegionInfo()
{ {
} }
@ -100,6 +103,11 @@ namespace OpenSim.Framework
public string RemotingAddress; public string RemotingAddress;
/// <value>
/// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw.
///
/// XXX Isn't this really doing too much to be a simple getter, rather than an explict method?
/// </value>
public IPEndPoint ExternalEndPoint public IPEndPoint ExternalEndPoint
{ {
get get
@ -115,7 +123,6 @@ namespace OpenSim.Framework
// Reset for next check // Reset for next check
ia = null; ia = null;
// New method favors IPv4
foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName))
{ {
if (ia == null) if (ia == null)

View File

@ -206,11 +206,7 @@ namespace OpenSim.Region.Communications.OGS1
return returnGridSettings; return returnGridSettings;
} }
/// <summary> // see IGridServices
///
/// </summary>
/// <param name="regionInfo"></param>
/// <returns></returns>
public List<SimpleRegionInfo> RequestNeighbours(uint x, uint y) public List<SimpleRegionInfo> RequestNeighbours(uint x, uint y)
{ {
Hashtable respData = MapBlockQuery((int) x - 1, (int) y - 1, (int) x + 1, (int) y + 1); Hashtable respData = MapBlockQuery((int) x - 1, (int) y - 1, (int) x + 1, (int) y + 1);

View File

@ -278,10 +278,27 @@ namespace OpenSim.Region.Environment.Scenes
agent.child = true; agent.child = true;
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
try
{
d.BeginInvoke(avatar, agent, neighbours[i].RegionHandle, neighbours[i].ExternalEndPoint, d.BeginInvoke(avatar, agent, neighbours[i].RegionHandle, neighbours[i].ExternalEndPoint,
InformClientOfNeighbourCompleted, InformClientOfNeighbourCompleted,
d); d);
} }
catch (Exception e)
{
m_log.ErrorFormat(
"[REGIONINFO]: Could not resolve external hostname {0} for region {1} ({2}, {3})",
neighbours[i].ExternalHostName,
neighbours[i].RegionHandle,
neighbours[i].RegionLocX,
neighbours[i].RegionLocY);
// FIXME: Okay, even though we've failed, we're still going to throw the exception on,
// since I don't know what will happen if we just let the client continue
throw e;
}
}
} }
} }