aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid
diff options
context:
space:
mode:
authorSean Dague2007-12-08 14:27:12 +0000
committerSean Dague2007-12-08 14:27:12 +0000
commit0855066968e30a9965088c14234b2bc93daf0481 (patch)
tree9f2a0c9a520af4bfa53fd3aa1ae651f0130bd5bb /OpenSim/Grid
parentset svn:eol-style (diff)
downloadopensim-SC-0855066968e30a9965088c14234b2bc93daf0481.zip
opensim-SC-0855066968e30a9965088c14234b2bc93daf0481.tar.gz
opensim-SC-0855066968e30a9965088c14234b2bc93daf0481.tar.bz2
opensim-SC-0855066968e30a9965088c14234b2bc93daf0481.tar.xz
This patch fixes mantis 105. Basically, it stops the index exception when
no root folder is found and it makes the user server wait longer for the inventory server to do its work. From Justin Casey (IBM)
Diffstat (limited to 'OpenSim/Grid')
-rw-r--r--OpenSim/Grid/UserServer/UserLoginService.cs34
1 files changed, 27 insertions, 7 deletions
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs
index f404cce..fa5eac5 100644
--- a/OpenSim/Grid/UserServer/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer/UserLoginService.cs
@@ -197,15 +197,32 @@ namespace OpenSim.Grid.UserServer
197 197
198 protected override InventoryData CreateInventoryData(LLUUID userID) 198 protected override InventoryData CreateInventoryData(LLUUID userID)
199 { 199 {
200 List<InventoryFolderBase> folders = SynchronousRestObjectPoster.BeginPostObject<LLUUID, List<InventoryFolderBase>>("POST", m_config.InventoryUrl + "RootFolders/", userID); 200 List<InventoryFolderBase> folders
201 if (folders ==null | folders.Count == 0) 201 = SynchronousRestObjectPoster.BeginPostObject<LLUUID, List<InventoryFolderBase>>(
202 "POST", m_config.InventoryUrl + "RootFolders/", userID);
203
204 // In theory, the user will only ever be missing a root folder in situations where a grid
205 // which didn't previously run a grid wide inventory server is being transitioned to one
206 // which does.
207 if (null == folders | folders.Count == 0)
202 { 208 {
203 RestObjectPoster.BeginPostObject<LLUUID>(m_config.InventoryUrl + "CreateInventory/", userID); 209 MainLog.Instance.Warn(
204 Thread.Sleep(1000); 210 "LOGIN",
205 folders = SynchronousRestObjectPoster.BeginPostObject<LLUUID, List<InventoryFolderBase>>("POST", m_config.InventoryUrl + "RootFolders/", userID); 211 "A root inventory folder for user ID " + userID + " was not found. A new set"
212 + " of empty inventory folders is being created.");
213
214 RestObjectPoster.BeginPostObject<LLUUID>(
215 m_config.InventoryUrl + "CreateInventory/", userID);
216
217 // A big delay should be okay here since the recreation of the user's root folders should
218 // only ever happen once. We need to sleep to let the inventory server do its work -
219 // previously 1000ms has been found to be too short.
220 Thread.Sleep(10000);
221 folders = SynchronousRestObjectPoster.BeginPostObject<LLUUID, List<InventoryFolderBase>>(
222 "POST", m_config.InventoryUrl + "RootFolders/", userID);
206 } 223 }
207 224
208 if(folders.Count >0) 225 if (folders.Count > 0)
209 { 226 {
210 LLUUID rootID = LLUUID.Zero; 227 LLUUID rootID = LLUUID.Zero;
211 ArrayList AgentInventoryArray = new ArrayList(); 228 ArrayList AgentInventoryArray = new ArrayList();
@@ -228,6 +245,9 @@ namespace OpenSim.Grid.UserServer
228 } 245 }
229 else 246 else
230 { 247 {
248 MainLog.Instance.Warn("LOGIN", "The root inventory folder could still not be retrieved" +
249 " for user ID " + userID);
250
231 AgentInventory userInventory = new AgentInventory(); 251 AgentInventory userInventory = new AgentInventory();
232 userInventory.CreateRootFolder(userID, false); 252 userInventory.CreateRootFolder(userID, false);
233 253
@@ -248,4 +268,4 @@ namespace OpenSim.Grid.UserServer
248 } 268 }
249 } 269 }
250 } 270 }
251} \ No newline at end of file 271}