aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2016-12-29 16:29:44 +0000
committerMelanie Thielker2016-12-29 16:29:44 +0000
commite0b5135010f2292f5c28232e874841b5ed92a559 (patch)
treea600053b00b9f063afe01afd745d529f4007305f
parentAdd negative caching to flotsam cache. Prevents scripts from hammering the as... (diff)
downloadopensim-SC_OLD-e0b5135010f2292f5c28232e874841b5ed92a559.zip
opensim-SC_OLD-e0b5135010f2292f5c28232e874841b5ed92a559.tar.gz
opensim-SC_OLD-e0b5135010f2292f5c28232e874841b5ed92a559.tar.bz2
opensim-SC_OLD-e0b5135010f2292f5c28232e874841b5ed92a559.tar.xz
Add a MaxRetries option to the inventory connector.
If clustered services are used, another try would go to another server and may succeed.
-rw-r--r--OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs17
-rw-r--r--bin/config-include/GridCommon.ini.example1
2 files changed, 16 insertions, 2 deletions
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
54 54
55 private string m_ServerURI = String.Empty; 55 private string m_ServerURI = String.Empty;
56 56
57 private int m_maxRetries = 0;
58
57 /// <summary> 59 /// <summary>
58 /// Timeout for remote requests. 60 /// Timeout for remote requests.
59 /// </summary> 61 /// </summary>
@@ -100,6 +102,7 @@ namespace OpenSim.Services.Connectors
100 m_ServerURI = serviceURI; 102 m_ServerURI = serviceURI;
101 103
102 m_requestTimeoutSecs = config.GetInt("RemoteRequestTimeout", m_requestTimeoutSecs); 104 m_requestTimeoutSecs = config.GetInt("RemoteRequestTimeout", m_requestTimeoutSecs);
105 m_maxRetries = config.GetInt("MaxRetries", m_maxRetries);
103 106
104 StatsManager.RegisterStat( 107 StatsManager.RegisterStat(
105 new Stat( 108 new Stat(
@@ -700,10 +703,20 @@ namespace OpenSim.Services.Connectors
700 703
701 RequestsMade++; 704 RequestsMade++;
702 705
703 string reply 706 string reply = String.Empty;
704 = SynchronousRestFormsRequester.MakeRequest( 707 int retries = 0;
708
709 do
710 {
711 reply = SynchronousRestFormsRequester.MakeRequest(
705 "POST", m_ServerURI + "/xinventory", 712 "POST", m_ServerURI + "/xinventory",
706 ServerUtils.BuildQueryString(sendData), m_requestTimeoutSecs, m_Auth); 713 ServerUtils.BuildQueryString(sendData), m_requestTimeoutSecs, m_Auth);
714
715 if (reply != String.Empty)
716 break;
717
718 retries++;
719 } while (retries <= m_maxRetries);
707 720
708 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse( 721 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(
709 reply); 722 reply);
diff --git a/bin/config-include/GridCommon.ini.example b/bin/config-include/GridCommon.ini.example
index 0922cf5..10a5b47 100644
--- a/bin/config-include/GridCommon.ini.example
+++ b/bin/config-include/GridCommon.ini.example
@@ -85,6 +85,7 @@
85 ; Change this to your grid-wide inventory server 85 ; Change this to your grid-wide inventory server
86 ; 86 ;
87 InventoryServerURI = "${Const|BaseURL}:${Const|PrivatePort}" 87 InventoryServerURI = "${Const|BaseURL}:${Const|PrivatePort}"
88 ;MaxRetries = 0
88 89
89[GridInfo] 90[GridInfo]
90 ; 91 ;