Cleared up much confusion in PollServiceRequestManager. Here's the history:

When Melanie added the web fetch inventory throttle to core, she made the long poll requests (EQs) effectively be handled on an active loop. All those requests, if they existed, were being constantly dequeued, checked for events (which most often they didn't have), and requeued again. This was an active loop thread on a 100ms cycle!
This fixes the issue. Now the inventory requests, if they aren't ready to be served, are placed directly back in the queue, but the long poll requests aren't placed there until there are events ready to be sent or timeout has been reached.
This puts the LongPollServiceWatcherThread back to 1sec cycle, as it was before.
This commit is contained in:
Diva Canto
2013-07-17 11:19:36 -07:00
parent 894554faf6
commit e46459ef21
4 changed files with 41 additions and 52 deletions

View File

@@ -364,8 +364,7 @@ namespace OpenSim.Region.ClientStack.Linden
caps.RegisterPollHandler(
"EventQueueGet",
new PollServiceEventArgs(
null, GenerateEqgCapPath(eventQueueGetUUID), HasEvents, GetEvents, NoEvents, agentID, 40000));
new PollServiceEventArgs(null, GenerateEqgCapPath(eventQueueGetUUID), HasEvents, GetEvents, NoEvents, agentID, 40000));
Random rnd = new Random(Environment.TickCount);
lock (m_ids)
@@ -383,7 +382,10 @@ namespace OpenSim.Region.ClientStack.Linden
Queue<OSD> queue = GetQueue(agentID);
if (queue != null)
lock (queue)
{
//m_log.WarnFormat("POLLED FOR EVENTS BY {0} in {1} -- {2}", agentID, m_scene.RegionInfo.RegionName, queue.Count);
return queue.Count > 0;
}
return false;
}
@@ -406,7 +408,7 @@ namespace OpenSim.Region.ClientStack.Linden
public Hashtable GetEvents(UUID requestID, UUID pAgentId)
{
if (DebugLevel >= 2)
m_log.DebugFormat("POLLED FOR EQ MESSAGES BY {0} in {1}", pAgentId, m_scene.RegionInfo.RegionName);
m_log.WarnFormat("POLLED FOR EQ MESSAGES BY {0} in {1}", pAgentId, m_scene.RegionInfo.RegionName);
Queue<OSD> queue = TryGetQueue(pAgentId);
OSD element;