* Make inventory operations sync rather than async. This is to alleviate race conditions such as that in mantis #190

* Make inventory messages more verbose.  Hopefully they aren't now too verbose
* This may resolve some grid instability but it's likely there's much more out there.
afrisby
Justin Clarke Casey 2007-12-15 19:42:23 +00:00
parent e3dd15bef0
commit c63369017f
4 changed files with 53 additions and 39 deletions

View File

@ -31,6 +31,7 @@ using System.Collections.Generic;
using System.Text;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Console;
using libsecondlife;
namespace OpenSim.Grid.InventoryServer
@ -105,9 +106,10 @@ namespace OpenSim.Grid.InventoryServer
public InventoryCollection GetUserInventory(Guid rawUserID)
{
Console.WriteLine("Request for Inventory for " + rawUserID.ToString());
LLUUID userID = new LLUUID(rawUserID);
MainLog.Instance.Verbose("INVENTORY", "Request for inventory for " + userID.ToStringHyphenated());
InventoryCollection invCollection = new InventoryCollection();
List<InventoryFolderBase> folders;
List<InventoryItemBase> allItems;
@ -124,7 +126,9 @@ namespace OpenSim.Grid.InventoryServer
{
LLUUID userID = new LLUUID(rawUserID);
Console.WriteLine("Creating New Set of Inventory Folders for " + userID.ToStringHyphenated());
MainLog.Instance.Verbose(
"INVENTORY", "Creating new set of inventory folders for " + userID.ToStringHyphenated());
CreateNewUserInventory(userID);
return true;
}
@ -145,27 +149,49 @@ namespace OpenSim.Grid.InventoryServer
AddItem(item);
}
public bool AddInventoryFolder( InventoryFolderBase folder)
public bool AddInventoryFolder(InventoryFolderBase folder)
{
// Right now, this actions act more like an update/insert combination than a simple create.
MainLog.Instance.Verbose(
"INVENTORY",
"Updating in " + folder.parentID.ToStringHyphenated()
+ ", folder " + folder.name);
AddNewInventoryFolder(folder.agentID, folder);
return true;
}
public bool MoveInventoryFolder(InventoryFolderBase folder)
{
{
MainLog.Instance.Verbose(
"INVENTORY",
"Moving folder " + folder.folderID
+ " to " + folder.parentID.ToStringHyphenated());
MoveExistingInventoryFolder(folder);
return true;
}
public bool AddInventoryItem( InventoryItemBase item)
{
Console.WriteLine("creating new item for " + item.avatarID.ToString());
// Right now, this actions act more like an update/insert combination than a simple create.
MainLog.Instance.Verbose(
"INVENTORY",
"Updating in " + item.parentFolderID.ToStringHyphenated()
+ ", item " + item.inventoryName);
AddNewInventoryItem(item.avatarID, item);
return true;
}
public override void DeleteInventoryItem(LLUUID userID, InventoryItemBase item)
{
// extra spaces to align with other inventory messages
MainLog.Instance.Verbose(
"INVENTORY",
"Deleting in " + item.parentFolderID.ToStringHyphenated()
+ ", item " + item.inventoryName);
DeleteItem(item);
}

View File

@ -60,7 +60,7 @@ namespace OpenSim.Grid.UserServer
public override void CustomiseResponse(LoginResponse response, UserProfileData theUser)
{
bool tryDefault = false;
System.Console.WriteLine("Load information from the gridserver");
MainLog.Instance.Verbose("LOGIN", "Load information from the gridserver");
RegionProfileData SimInfo = new RegionProfileData();
try
{
@ -69,7 +69,7 @@ namespace OpenSim.Grid.UserServer
m_config.GridSendKey, m_config.GridRecvKey);
// Customise the response
System.Console.WriteLine("Home Location");
MainLog.Instance.Verbose("LOGIN", "Home Location");
response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * 256).ToString() + ",r" +
(SimInfo.regionLocY * 256).ToString() + "], " +
"'position':[r" + theUser.homeLocation.X.ToString() + ",r" +
@ -128,7 +128,11 @@ namespace OpenSim.Grid.UserServer
// Load information from the gridserver
ulong defaultHandle = (((ulong)m_config.DefaultX * 256) << 32) | ((ulong) m_config.DefaultY * 256);
MainLog.Instance.Warn("Home region not available: sending to default region " + defaultHandle.ToString());
MainLog.Instance.Warn(
"LOGIN",
"Home region not available: sending to default region " + defaultHandle.ToString());
SimInfo = new RegionProfileData();
try
{
@ -137,7 +141,7 @@ namespace OpenSim.Grid.UserServer
m_config.GridSendKey, m_config.GridRecvKey);
// Customise the response
System.Console.WriteLine("Home Location");
MainLog.Instance.Verbose("LOGIN", "Home Location");
response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * 256).ToString() + ",r" +
(SimInfo.regionLocY * 256).ToString() + "], " +
"'position':[r" + theUser.homeLocation.X.ToString() + ",r" +
@ -189,7 +193,7 @@ namespace OpenSim.Grid.UserServer
catch (Exception e)
{
MainLog.Instance.Warn("LOGIN", "Default region also not available");
MainLog.Instance.Verbose("LOGIN", e.ToString());
MainLog.Instance.Warn("LOGIN", e.ToString());
}
}

View File

@ -117,45 +117,26 @@ namespace OpenSim.Region.Communications.OGS1
public void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder)
{
try
{
RestObjectPoster.BeginPostObject<InventoryFolderBase>(_inventoryServerUrl + "/NewFolder/", folder);
}
catch (Exception)
{
}
SynchronousRestObjectPoster.BeginPostObject<InventoryFolderBase, bool>(
"POST", _inventoryServerUrl + "/NewFolder/", folder);
}
public void MoveInventoryFolder(LLUUID userID, InventoryFolderBase folder)
{
try
{
RestObjectPoster.BeginPostObject<InventoryFolderBase>(_inventoryServerUrl + "/MoveFolder/", folder);
}
catch (Exception)
{
}
SynchronousRestObjectPoster.BeginPostObject<InventoryFolderBase, bool>(
"POST", _inventoryServerUrl + "/MoveFolder/", folder);
}
public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item)
{
try
{
RestObjectPoster.BeginPostObject<InventoryItemBase>(_inventoryServerUrl + "/NewItem/", item);
}
catch (Exception)
{
}
SynchronousRestObjectPoster.BeginPostObject<InventoryItemBase, bool>(
"POST", _inventoryServerUrl + "/NewItem/", item);
}
public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item)
{
try
{
RestObjectPoster.BeginPostObject<InventoryItemBase>(_inventoryServerUrl + "/DeleteItem/", item);
}
catch (Exception)
{
}
SynchronousRestObjectPoster.BeginPostObject<InventoryItemBase, bool>(
"POST", _inventoryServerUrl + "/DeleteItem/", item);
}
public void CreateNewUserInventory(LLUUID user)

View File

@ -238,7 +238,10 @@ namespace OpenSim.Region.Environment.Scenes
public void MoveInventoryItem(IClientAPI remoteClient,LLUUID folderID, LLUUID itemID, int length, string newName)
{
MainLog.Instance.Verbose("INVENTORY", "Moving item for " + remoteClient.AgentId.ToStringHyphenated());
MainLog.Instance.Verbose(
"INVENTORY",
"Moving item for " + remoteClient.AgentId.ToStringHyphenated());
CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
if (userInfo == null)
{