For built-in groups, if a delegate throws an exception (e.g. due to network failure), always remove its request from the m_ActiveRequests list.

If this is not done, all subsequent calls for the same data see that a request is apparantly already in progress and so wait for the result indefinitely.
inv-download
Justin Clark-Casey (justincc) 2015-02-04 17:04:59 +00:00
parent 6834393821
commit 765fd02418
1 changed files with 128 additions and 69 deletions

View File

@ -144,6 +144,8 @@ namespace OpenSim.Groups
}
if (firstCall)
{
try
{
//group = m_GroupsService.GetGroupRecord(RequestingAgentID, GroupID, GroupName);
group = d();
@ -151,10 +153,14 @@ namespace OpenSim.Groups
lock (m_Cache)
{
m_Cache.AddOrUpdate(cacheKey, group, GROUPS_CACHE_TIMEOUT);
m_ActiveRequests.Remove(cacheKey);
return (ExtendedGroupRecord)group;
}
}
finally
{
m_ActiveRequests.Remove(cacheKey);
}
}
else
Thread.Sleep(50);
}
@ -243,16 +249,22 @@ namespace OpenSim.Groups
}
if (firstCall)
{
try
{
membership = d();
lock (m_Cache)
{
m_Cache.AddOrUpdate(cacheKey, membership, GROUPS_CACHE_TIMEOUT);
m_ActiveRequests.Remove(cacheKey);
return (ExtendedGroupMembershipData)membership;
}
}
finally
{
m_ActiveRequests.Remove(cacheKey);
}
}
else
Thread.Sleep(50);
}
@ -286,15 +298,21 @@ namespace OpenSim.Groups
}
if (firstCall)
{
try
{
membership = d();
lock (m_Cache)
{
m_Cache.AddOrUpdate(cacheKey, membership, GROUPS_CACHE_TIMEOUT);
m_ActiveRequests.Remove(cacheKey);
return (ExtendedGroupMembershipData)membership;
}
}
finally
{
m_ActiveRequests.Remove(cacheKey);
}
}
else
Thread.Sleep(50);
}
@ -327,15 +345,21 @@ namespace OpenSim.Groups
}
if (firstCall)
{
try
{
memberships = d();
lock (m_Cache)
{
m_Cache.AddOrUpdate(cacheKey, memberships, GROUPS_CACHE_TIMEOUT);
m_ActiveRequests.Remove(cacheKey);
return (List<GroupMembershipData>)memberships;
}
}
finally
{
m_ActiveRequests.Remove(cacheKey);
}
}
else
Thread.Sleep(50);
}
@ -369,6 +393,8 @@ namespace OpenSim.Groups
}
if (firstCall)
{
try
{
List<ExtendedGroupMembersData> _members = d();
@ -381,11 +407,15 @@ namespace OpenSim.Groups
{
//m_Cache.AddOrUpdate(cacheKey, members, GROUPS_CACHE_TIMEOUT);
m_Cache.AddOrUpdate(cacheKey, _members, GROUPS_CACHE_TIMEOUT);
m_ActiveRequests.Remove(cacheKey);
return (List<GroupMembersData>)members;
}
}
finally
{
m_ActiveRequests.Remove(cacheKey);
}
}
else
Thread.Sleep(50);
}
@ -497,6 +527,8 @@ namespace OpenSim.Groups
}
if (firstCall)
{
try
{
roles = d();
if (roles != null)
@ -504,11 +536,15 @@ namespace OpenSim.Groups
lock (m_Cache)
{
m_Cache.AddOrUpdate(cacheKey, roles, GROUPS_CACHE_TIMEOUT);
m_ActiveRequests.Remove(cacheKey);
return (List<GroupRolesData>)roles;
}
}
}
finally
{
m_ActiveRequests.Remove(cacheKey);
}
}
else
Thread.Sleep(50);
}
@ -541,6 +577,8 @@ namespace OpenSim.Groups
}
if (firstCall)
{
try
{
List<ExtendedGroupRoleMembersData> _rmembers = d();
@ -557,10 +595,14 @@ namespace OpenSim.Groups
// Caching the list of ExtendedGroupRoleMembersData doesn't show that issue
// I don't get it.
m_Cache.AddOrUpdate(cacheKey, _rmembers, GROUPS_CACHE_TIMEOUT);
m_ActiveRequests.Remove(cacheKey);
return (List<GroupRoleMembersData>)rmembers;
}
}
finally
{
m_ActiveRequests.Remove(cacheKey);
}
}
else
Thread.Sleep(50);
}
@ -666,6 +708,8 @@ namespace OpenSim.Groups
}
if (firstCall)
{
try
{
roles = d();
lock (m_Cache)
@ -675,6 +719,11 @@ namespace OpenSim.Groups
return (List<GroupRolesData>)roles;
}
}
finally
{
m_ActiveRequests.Remove(cacheKey);
}
}
else
Thread.Sleep(50);
}
@ -767,16 +816,22 @@ namespace OpenSim.Groups
}
if (firstCall)
{
try
{
GroupNoticeInfo _notice = d();
lock (m_Cache)
{
m_Cache.AddOrUpdate(cacheKey, _notice, GROUPS_CACHE_TIMEOUT);
m_ActiveRequests.Remove(cacheKey);
return _notice;
}
}
finally
{
m_ActiveRequests.Remove(cacheKey);
}
}
else
Thread.Sleep(50);
}
@ -809,21 +864,25 @@ namespace OpenSim.Groups
}
if (firstCall)
{
try
{
notices = d();
lock (m_Cache)
{
m_Cache.AddOrUpdate(cacheKey, notices, GROUPS_CACHE_TIMEOUT);
m_ActiveRequests.Remove(cacheKey);
return (List<ExtendedGroupNoticeData>)notices;
}
}
finally
{
m_ActiveRequests.Remove(cacheKey);
}
}
else
Thread.Sleep(50);
}
}
}
}