From f021c64eb060046bff6e91384e1bbca0384b7d61 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 29 Dec 2016 12:34:09 +0000 Subject: Refactor: Rename IImprovedAssetCache to IAssetCache as the old IAssetCache is long gone. --- OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 4 ++-- OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index a6e8eb4..b8449d7 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -49,7 +49,7 @@ namespace OpenSim.Services.Connectors const int MAXSENDRETRIESLEN = 30; private string m_ServerURI = String.Empty; - private IImprovedAssetCache m_Cache = null; + private IAssetCache m_Cache = null; private int m_retryCounter; private bool m_inRetries; private List[] m_sendRetries = new List[MAXSENDRETRIESLEN]; @@ -233,7 +233,7 @@ namespace OpenSim.Services.Connectors } } - protected void SetCache(IImprovedAssetCache cache) + protected void SetCache(IAssetCache cache) { m_Cache = cache; } diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 9ad4a7a..531939f 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs @@ -55,7 +55,7 @@ namespace OpenSim.Services.Connectors.SimianGrid private static string ZeroID = UUID.Zero.ToString(); private string m_serverUrl = String.Empty; - private IImprovedAssetCache m_cache; + private IAssetCache m_cache; private bool m_Enabled = false; #region ISharedRegionModule @@ -65,7 +65,7 @@ namespace OpenSim.Services.Connectors.SimianGrid { if (m_cache == null) { - IImprovedAssetCache cache = scene.RequestModuleInterface(); + IAssetCache cache = scene.RequestModuleInterface(); if (cache is ISharedRegionModule) m_cache = cache; } -- cgit v1.1 From 07b48fd58c343d18b8ce64179e344439070511e8 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 29 Dec 2016 15:47:46 +0000 Subject: Add negative caching to flotsam cache. Prevents scripts from hammering the asset server --- OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index b8449d7..bdc3bef 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -260,8 +260,13 @@ namespace OpenSim.Services.Connectors asset = SynchronousRestObjectRequester.MakeRequest("GET", uri, 0, m_Auth); - if (asset != null && m_Cache != null) - m_Cache.Cache(asset); + if (m_Cache != null) + { + if (asset != null) + m_Cache.Cache(asset); + else + m_Cache.CacheNegative(id); + } } return asset; } -- cgit v1.1 From e0b5135010f2292f5c28232e874841b5ed92a559 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 29 Dec 2016 16:29:44 +0000 Subject: Add a MaxRetries option to the inventory connector. If clustered services are used, another try would go to another server and may succeed. --- .../Connectors/Inventory/XInventoryServicesConnector.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs index d80e660..2ddd7a2 100644 --- a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs @@ -54,6 +54,8 @@ namespace OpenSim.Services.Connectors private string m_ServerURI = String.Empty; + private int m_maxRetries = 0; + /// /// Timeout for remote requests. /// @@ -100,6 +102,7 @@ namespace OpenSim.Services.Connectors m_ServerURI = serviceURI; m_requestTimeoutSecs = config.GetInt("RemoteRequestTimeout", m_requestTimeoutSecs); + m_maxRetries = config.GetInt("MaxRetries", m_maxRetries); StatsManager.RegisterStat( new Stat( @@ -700,10 +703,20 @@ namespace OpenSim.Services.Connectors RequestsMade++; - string reply - = SynchronousRestFormsRequester.MakeRequest( + string reply = String.Empty; + int retries = 0; + + do + { + reply = SynchronousRestFormsRequester.MakeRequest( "POST", m_ServerURI + "/xinventory", ServerUtils.BuildQueryString(sendData), m_requestTimeoutSecs, m_Auth); + + if (reply != String.Empty) + break; + + retries++; + } while (retries <= m_maxRetries); Dictionary replyData = ServerUtils.ParseXmlResponse( reply); -- cgit v1.1