aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors
diff options
context:
space:
mode:
authorMelanie2012-09-04 22:53:52 +0200
committerMelanie2012-09-04 22:53:52 +0200
commit9ae293881addf98844b8f292298bc0674ebbed0d (patch)
treea3ce8a6bcb133c964f0b115094c1abef1e5c5cc3 /OpenSim/Services/Connectors
parentMerge branch 'ubitwork' into avination (diff)
downloadopensim-SC-9ae293881addf98844b8f292298bc0674ebbed0d.zip
opensim-SC-9ae293881addf98844b8f292298bc0674ebbed0d.tar.gz
opensim-SC-9ae293881addf98844b8f292298bc0674ebbed0d.tar.bz2
opensim-SC-9ae293881addf98844b8f292298bc0674ebbed0d.tar.xz
Make friend notifies and closing child agents async because both can
block the heartbeat thread if the sim being contacted is unresponsive
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs68
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs21
2 files changed, 47 insertions, 42 deletions
diff --git a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
index 3fd0c53..6cd21d1 100644
--- a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
+++ b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
@@ -144,44 +144,48 @@ namespace OpenSim.Services.Connectors.Friends
144 144
145 private bool Call(GridRegion region, Dictionary<string, object> sendData) 145 private bool Call(GridRegion region, Dictionary<string, object> sendData)
146 { 146 {
147 string reqString = ServerUtils.BuildQueryString(sendData); 147 Util.FireAndForget(x => {
148 //m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: queryString = {0}", reqString); 148 string reqString = ServerUtils.BuildQueryString(sendData);
149 if (region == null) 149 //m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: queryString = {0}", reqString);
150 return false; 150 if (region == null)
151 151 return;
152 string path = ServicePath(); 152
153 if (!region.ServerURI.EndsWith("/")) 153 string path = ServicePath();
154 path = "/" + path; 154 if (!region.ServerURI.EndsWith("/"))
155 string uri = region.ServerURI + path; 155 path = "/" + path;
156 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: calling {0}", uri); 156 string uri = region.ServerURI + path;
157 157 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: calling {0}", uri);
158 try 158
159 { 159 try
160 string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
161 if (reply != string.Empty)
162 { 160 {
163 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 161 string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
164 162 if (reply != string.Empty)
165 if (replyData.ContainsKey("RESULT"))
166 { 163 {
167 if (replyData["RESULT"].ToString().ToLower() == "true") 164 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
168 return true; 165
166 if (replyData.ContainsKey("RESULT"))
167 {
168// if (replyData["RESULT"].ToString().ToLower() == "true")
169// return;
170// else
171 return;
172 }
169 else 173 else
170 return false; 174 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: reply data does not contain result field");
175
171 } 176 }
172 else 177 else
173 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: reply data does not contain result field"); 178 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: received empty reply");
174 179 }
180 catch (Exception e)
181 {
182 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: Exception when contacting remote sim at {0}: {1}", uri, e.Message);
175 } 183 }
176 else 184
177 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: received empty reply"); 185 return;
178 } 186 });
179 catch (Exception e) 187
180 { 188 return true;
181 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: Exception when contacting remote sim at {0}: {1}", uri, e.Message);
182 }
183
184 return false;
185 } 189 }
186 } 190 }
187} 191}
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index e1c2243..508baf7 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -395,17 +395,18 @@ namespace OpenSim.Services.Connectors.Simulation
395 private bool CloseAgent(GridRegion destination, UUID id, bool ChildOnly) 395 private bool CloseAgent(GridRegion destination, UUID id, bool ChildOnly)
396 { 396 {
397// m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CloseAgent start"); 397// m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CloseAgent start");
398 Util.FireAndForget(x => {
399 string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
398 400
399 string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; 401 try
400 402 {
401 try 403 WebUtil.ServiceOSDRequest(uri, null, "DELETE", 10000, false);
402 { 404 }
403 WebUtil.ServiceOSDRequest(uri, null, "DELETE", 10000, false); 405 catch (Exception e)
404 } 406 {
405 catch (Exception e) 407 m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] CloseAgent failed with exception; {0}",e.ToString());
406 { 408 }
407 m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] CloseAgent failed with exception; {0}",e.ToString()); 409 });
408 }
409 410
410 return true; 411 return true;
411 } 412 }