* Allow a grid mode region simulator to properly shutdown even if the grid service is offline
0.6.0-stable
Justin Clarke Casey 2008-09-21 16:58:14 +00:00
parent f6071c030d
commit 1a71a3a567
4 changed files with 45 additions and 6 deletions

View File

@ -47,6 +47,12 @@ namespace OpenSim.Framework.Communications
/// <exception cref="System.Exception">Thrown if region registration failed</exception>
RegionCommsListener RegisterRegion(RegionInfo regionInfos);
/// <summary>
/// Deregister a region with the grid service.
/// </summary>
/// <param name="regionInfo"></param>
/// <returns></returns>
/// <exception cref="System.Exception">Thrown if region deregistration failed</exception>
bool DeregisterRegion(RegionInfo regionInfo);
/// <summary>

View File

@ -96,6 +96,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// A list of the packets we haven't acked yet
//
private Dictionary<uint,uint> m_PendingAcks = new Dictionary<uint,uint>();
// Dictionary of the packets that need acks from the client.
//
private class AckData
@ -109,6 +110,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public Packet Packet;
public Object Identifier;
}
private Dictionary<uint, AckData> m_NeedAck =
new Dictionary<uint, AckData>();

View File

@ -141,11 +141,11 @@ namespace OpenSim.Region.Communications.OGS1
SendParams.Add(GridParams);
// Send Request
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
XmlRpcResponse GridResp;
try
{
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
// The timeout should always be significantly larger than the timeout for the grid server to request
// the initial status of the region before confirming registration.
GridResp = GridReq.Send(serversInfo.GridURL, 90000);
@ -154,7 +154,9 @@ namespace OpenSim.Region.Communications.OGS1
{
Exception e2
= new Exception(
String.Format("Unable to connect to grid at {0}. Grid service not running?", serversInfo.GridURL),
String.Format(
"Unable to register region with grid at {0}. Grid service not running?",
serversInfo.GridURL),
e);
throw(e2);
@ -193,6 +195,7 @@ namespace OpenSim.Region.Communications.OGS1
return m_localBackend.RegisterRegion(regionInfo);
}
// see IGridServices
public bool DeregisterRegion(RegionInfo regionInfo)
{
Hashtable GridParams = new Hashtable();
@ -205,7 +208,24 @@ namespace OpenSim.Region.Communications.OGS1
// Send Request
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_after_region_moved", SendParams);
XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 10000);
XmlRpcResponse GridResp = null;
try
{
GridResp = GridReq.Send(serversInfo.GridURL, 10000);
}
catch (Exception e)
{
Exception e2
= new Exception(
String.Format(
"Unable to deregister region with grid at {0}. Grid service not running?",
serversInfo.GridURL),
e);
throw(e2);
}
Hashtable GridRespData = (Hashtable) GridResp.Value;
// Hashtable griddatahash = GridRespData;

View File

@ -135,7 +135,18 @@ namespace OpenSim.Region.Environment.Scenes
regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing;
regionCommsHost.OnCloseAgentConnection -= CloseConnection;
regionCommsHost.OnGetLandData -= FetchLandData;
try
{
m_commsProvider.GridService.DeregisterRegion(m_regionInfo);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[GRID]: Deregistration of region {0} from the grid failed - {1}. Continuing",
m_regionInfo.RegionName, e);
}
regionCommsHost = null;
}
}