From 8738445eb70321e728c845b5095817b67aaca35b Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 9 Aug 2014 00:52:51 +0100
Subject: Move the inventory request lock introduced in git master a58152bd to
HGInventoryBroker to preserve that behaviour there but allow 2 simultaneous
inv requests (chiefly WebFetch) rather than 1
This lock serialized all requests and made the inventory throttling in WebFetch redundant.
By moving this lock, two simultaneous requests may now take place which may help with http://opensimulator.org/mantis/view.php?id=7054
---
.../Inventory/HGInventoryBroker.cs | 63 +++++++++++++++-------
1 file changed, 43 insertions(+), 20 deletions(-)
(limited to 'OpenSim/Region/CoreModules')
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
index 9179dc7..e13ee42 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
@@ -62,6 +62,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
private InventoryCache m_Cache = new InventoryCache();
+ ///
+ /// Used to serialize inventory requests.
+ ///
+ private object m_Lock = new object();
+
protected IUserManagement m_UserManagement;
protected IUserManagement UserManagementModule
{
@@ -301,7 +306,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
public bool CreateUserInventory(UUID userID)
{
- return m_LocalGridInventoryService.CreateUserInventory(userID);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.CreateUserInventory(userID);
}
public List GetInventorySkeleton(UUID userID)
@@ -309,7 +315,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(userID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.GetInventorySkeleton(userID);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.GetInventorySkeleton(userID);
IInventoryService connector = GetConnector(invURL);
@@ -326,7 +333,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(userID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.GetRootFolder(userID);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.GetRootFolder(userID);
IInventoryService connector = GetConnector(invURL);
@@ -347,7 +355,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(userID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.GetFolderForType(userID, type);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.GetFolderForType(userID, type);
IInventoryService connector = GetConnector(invURL);
@@ -365,7 +374,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(userID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.GetFolderContent(userID, folderID);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.GetFolderContent(userID, folderID);
InventoryCollection c = m_Cache.GetFolderContent(userID, folderID);
if (c != null)
@@ -375,8 +385,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
}
IInventoryService connector = GetConnector(invURL);
- return connector.GetFolderContent(userID, folderID);
+ return connector.GetFolderContent(userID, folderID);
}
public List GetFolderItems(UUID userID, UUID folderID)
@@ -386,7 +396,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(userID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.GetFolderItems(userID, folderID);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.GetFolderItems(userID, folderID);
List items = m_Cache.GetFolderItems(userID, folderID);
if (items != null)
@@ -396,8 +407,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
}
IInventoryService connector = GetConnector(invURL);
- return connector.GetFolderItems(userID, folderID);
+ return connector.GetFolderItems(userID, folderID);
}
public bool AddFolder(InventoryFolderBase folder)
@@ -410,7 +421,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(folder.Owner);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.AddFolder(folder);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.AddFolder(folder);
IInventoryService connector = GetConnector(invURL);
@@ -427,7 +439,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(folder.Owner);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.UpdateFolder(folder);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.UpdateFolder(folder);
IInventoryService connector = GetConnector(invURL);
@@ -446,7 +459,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(ownerID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.DeleteFolders(ownerID, folderIDs);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.DeleteFolders(ownerID, folderIDs);
IInventoryService connector = GetConnector(invURL);
@@ -463,7 +477,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(folder.Owner);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.MoveFolder(folder);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.MoveFolder(folder);
IInventoryService connector = GetConnector(invURL);
@@ -480,7 +495,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(folder.Owner);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.PurgeFolder(folder);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.PurgeFolder(folder);
IInventoryService connector = GetConnector(invURL);
@@ -497,7 +513,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(item.Owner);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.AddItem(item);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.AddItem(item);
IInventoryService connector = GetConnector(invURL);
@@ -514,7 +531,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(item.Owner);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.UpdateItem(item);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.UpdateItem(item);
IInventoryService connector = GetConnector(invURL);
@@ -533,7 +551,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(ownerID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.MoveItems(ownerID, items);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.MoveItems(ownerID, items);
IInventoryService connector = GetConnector(invURL);
@@ -552,7 +571,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(ownerID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.DeleteItems(ownerID, itemIDs);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.DeleteItems(ownerID, itemIDs);
IInventoryService connector = GetConnector(invURL);
@@ -568,7 +588,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(item.Owner);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.GetItem(item);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.GetItem(item);
IInventoryService connector = GetConnector(invURL);
@@ -585,7 +606,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(folder.Owner);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.GetFolder(folder);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.GetFolder(folder);
IInventoryService connector = GetConnector(invURL);
@@ -609,7 +631,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(userID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.GetAssetPermissions(userID, assetID);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.GetAssetPermissions(userID, assetID);
IInventoryService connector = GetConnector(invURL);
--
cgit v1.1