fix drop on delayed events processing

httptests
UbitUmarov 2016-07-17 14:15:46 +01:00
parent 442b272228
commit e881562d34
3 changed files with 143 additions and 58 deletions

View File

@ -222,6 +222,7 @@ namespace OpenSim.Region.ClientStack.Linden
new List<Hashtable>();
private Dictionary<UUID, aPollResponse> responses =
new Dictionary<UUID, aPollResponse>();
private HashSet<UUID> dropedResponses = new HashSet<UUID>();
private Scene m_scene;
private MeshCapsDataThrottler m_throttler;
@ -247,6 +248,8 @@ namespace OpenSim.Region.ClientStack.Linden
lock (responses)
{
responses.Remove(x);
lock(dropedResponses)
dropedResponses.Add(x);
}
};
@ -307,6 +310,17 @@ namespace OpenSim.Region.ClientStack.Linden
if(m_scene.ShuttingDown)
return;
lock(responses)
{
lock(dropedResponses)
{
if(dropedResponses.Contains(requestID))
{
dropedResponses.Remove(requestID);
return;
}
}
// If the avatar is gone, don't bother to get the texture
if (m_scene.GetScenePresence(Id) == null)
{
@ -318,15 +332,25 @@ namespace OpenSim.Region.ClientStack.Linden
response["keepalive"] = false;
response["reusecontext"] = false;
lock (responses)
responses[requestID] = new aPollResponse() { bytes = 0, response = response, lod = 0 };
return;
}
}
response = m_getMeshHandler.Handle(requestinfo.request);
lock (responses)
{
lock(dropedResponses)
{
if(dropedResponses.Contains(requestID))
{
dropedResponses.Remove(requestID);
return;
}
}
responses[requestID] = new aPollResponse()
{
bytes = (int)response["int_bytes"],

View File

@ -218,6 +218,7 @@ namespace OpenSim.Region.ClientStack.Linden
new List<Hashtable>();
private Dictionary<UUID, aPollResponse> responses =
new Dictionary<UUID, aPollResponse>();
private HashSet<UUID> dropedResponses = new HashSet<UUID>();
private Scene m_scene;
private CapsDataThrottler m_throttler = new CapsDataThrottler(100000, 1400000,10000);
@ -237,7 +238,14 @@ namespace OpenSim.Region.ClientStack.Linden
}
};
Drop = (x, y) => { lock (responses) responses.Remove(x); };
Drop = (x, y) =>
{
lock (responses)
{
responses.Remove(x);
dropedResponses.Add(x);
}
};
GetEvents = (x, y) =>
{
@ -307,6 +315,17 @@ namespace OpenSim.Region.ClientStack.Linden
if(m_scene.ShuttingDown)
return;
lock (responses)
{
lock(dropedResponses)
{
if(dropedResponses.Contains(requestID))
{
dropedResponses.Remove(requestID);
return;
}
}
if (requestinfo.send503)
{
response = new Hashtable();
@ -321,7 +340,6 @@ namespace OpenSim.Region.ClientStack.Linden
headers["Retry-After"] = 30;
response["headers"] = headers;
lock (responses)
responses[requestID] = new aPollResponse() {bytes = 0, response = response};
return;
@ -338,21 +356,30 @@ namespace OpenSim.Region.ClientStack.Linden
response["keepalive"] = false;
response["reusecontext"] = false;
lock (responses)
responses[requestID] = new aPollResponse() {bytes = 0, response = response};
return;
}
}
response = m_getTextureHandler.Handle(requestinfo.request);
lock (responses)
{
lock(dropedResponses)
{
if(dropedResponses.Contains(requestID))
{
dropedResponses.Remove(requestID);
m_throttler.ProcessTime();
return;
}
}
responses[requestID] = new aPollResponse()
{
bytes = (int) response["int_bytes"],
response = response
};
}
m_throttler.ProcessTime();
}

View File

@ -250,8 +250,8 @@ namespace OpenSim.Region.ClientStack.Linden
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Dictionary<UUID, Hashtable> responses =
new Dictionary<UUID, Hashtable>();
private Dictionary<UUID, Hashtable> responses = new Dictionary<UUID, Hashtable>();
private HashSet<UUID> dropedResponses = new HashSet<UUID>();
private WebFetchInvDescModule m_module;
@ -261,7 +261,16 @@ namespace OpenSim.Region.ClientStack.Linden
m_module = module;
HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); };
Drop = (x, y) => { lock (responses) responses.Remove(x); };
Drop = (x, y) =>
{
lock (responses)
{
responses.Remove(x);
lock(dropedResponses)
dropedResponses.Add(x);
}
};
GetEvents = (x, y) =>
{
@ -367,6 +376,19 @@ namespace OpenSim.Region.ClientStack.Linden
UUID requestID = requestinfo.reqID;
lock(responses)
{
lock(dropedResponses)
{
if(dropedResponses.Contains(requestID))
{
dropedResponses.Remove(requestID);
return;
}
}
}
Hashtable response = new Hashtable();
response["int_response_code"] = 200;
@ -379,6 +401,18 @@ namespace OpenSim.Region.ClientStack.Linden
lock (responses)
{
lock(dropedResponses)
{
if(dropedResponses.Contains(requestID))
{
dropedResponses.Remove(requestID);
requestinfo.folders.Clear();
requestinfo.request.Clear();
WebFetchInvDescModule.ProcessedRequestsCount++;
return;
}
}
if (responses.ContainsKey(requestID))
m_log.WarnFormat("[FETCH INVENTORY DESCENDENTS2 MODULE]: Caught in the act of loosing responses! Please report this on mantis #7054");
responses[requestID] = response;