Make friend notifies and closing child agents async because both can

block the heartbeat thread if the sim being contacted is unresponsive
avinationmerge
Melanie 2012-09-04 22:53:52 +02:00
parent 8a537f8f66
commit 9ae293881a
3 changed files with 45 additions and 40 deletions

View File

@ -3432,7 +3432,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="e"></param>
public void PhysicsCollisionUpdate(EventArgs e)
{
if (IsChildAgent)
if (IsChildAgent || Animator == null)
return;
//if ((Math.Abs(Velocity.X) > 0.1e-9f) || (Math.Abs(Velocity.Y) > 0.1e-9f))

View File

@ -144,44 +144,48 @@ namespace OpenSim.Services.Connectors.Friends
private bool Call(GridRegion region, Dictionary<string, object> sendData)
{
string reqString = ServerUtils.BuildQueryString(sendData);
//m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: queryString = {0}", reqString);
if (region == null)
return false;
Util.FireAndForget(x => {
string reqString = ServerUtils.BuildQueryString(sendData);
//m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: queryString = {0}", reqString);
if (region == null)
return;
string path = ServicePath();
if (!region.ServerURI.EndsWith("/"))
path = "/" + path;
string uri = region.ServerURI + path;
m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: calling {0}", uri);
string path = ServicePath();
if (!region.ServerURI.EndsWith("/"))
path = "/" + path;
string uri = region.ServerURI + path;
m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: calling {0}", uri);
try
{
string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
if (reply != string.Empty)
try
{
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
if (replyData.ContainsKey("RESULT"))
string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
if (reply != string.Empty)
{
if (replyData["RESULT"].ToString().ToLower() == "true")
return true;
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
if (replyData.ContainsKey("RESULT"))
{
// if (replyData["RESULT"].ToString().ToLower() == "true")
// return;
// else
return;
}
else
return false;
m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: reply data does not contain result field");
}
else
m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: reply data does not contain result field");
m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: received empty reply");
}
catch (Exception e)
{
m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: Exception when contacting remote sim at {0}: {1}", uri, e.Message);
}
else
m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: received empty reply");
}
catch (Exception e)
{
m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: Exception when contacting remote sim at {0}: {1}", uri, e.Message);
}
return false;
return;
});
return true;
}
}
}

View File

@ -395,17 +395,18 @@ namespace OpenSim.Services.Connectors.Simulation
private bool CloseAgent(GridRegion destination, UUID id, bool ChildOnly)
{
// m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CloseAgent start");
Util.FireAndForget(x => {
string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
try
{
WebUtil.ServiceOSDRequest(uri, null, "DELETE", 10000, false);
}
catch (Exception e)
{
m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] CloseAgent failed with exception; {0}",e.ToString());
}
try
{
WebUtil.ServiceOSDRequest(uri, null, "DELETE", 10000, false);
}
catch (Exception e)
{
m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] CloseAgent failed with exception; {0}",e.ToString());
}
});
return true;
}