Merge branch 'master' into careminster

Conflicts:
	OpenSim/Region/Framework/Scenes/SceneGraph.cs
avinationmerge
Melanie 2012-01-25 00:45:57 +00:00
commit 427ab55058
10 changed files with 184 additions and 168 deletions

View File

@ -42,15 +42,15 @@ namespace OpenSim.Framework.Statistics
{
private long abnormalClientThreadTerminations;
private long assetsInCache;
private long texturesInCache;
private long assetCacheMemoryUsage;
private long textureCacheMemoryUsage;
private TimeSpan assetRequestTimeAfterCacheMiss;
private long blockedMissingTextureRequests;
// private long assetsInCache;
// private long texturesInCache;
// private long assetCacheMemoryUsage;
// private long textureCacheMemoryUsage;
// private TimeSpan assetRequestTimeAfterCacheMiss;
// private long blockedMissingTextureRequests;
private long assetServiceRequestFailures;
private long inventoryServiceRetrievalFailures;
// private long assetServiceRequestFailures;
// private long inventoryServiceRetrievalFailures;
private volatile float timeDilation;
private volatile float simFps;
@ -79,27 +79,27 @@ namespace OpenSim.Framework.Statistics
/// </summary>
public long AbnormalClientThreadTerminations { get { return abnormalClientThreadTerminations; } }
/// <summary>
/// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the
/// notion of providing some flow statistics (which pull wouldn't give us). Though admittedly these
/// haven't yet been implemented...
/// </summary>
public long AssetsInCache { get { return assetsInCache; } }
/// <value>
/// Currently unused
/// </value>
public long TexturesInCache { get { return texturesInCache; } }
/// <value>
/// Currently misleading since we can't currently subtract removed asset memory usage without a performance hit
/// </value>
public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } }
/// <value>
/// Currently unused
/// </value>
public long TextureCacheMemoryUsage { get { return textureCacheMemoryUsage; } }
// /// <summary>
// /// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the
// /// notion of providing some flow statistics (which pull wouldn't give us). Though admittedly these
// /// haven't yet been implemented...
// /// </summary>
// public long AssetsInCache { get { return assetsInCache; } }
//
// /// <value>
// /// Currently unused
// /// </value>
// public long TexturesInCache { get { return texturesInCache; } }
//
// /// <value>
// /// Currently misleading since we can't currently subtract removed asset memory usage without a performance hit
// /// </value>
// public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } }
//
// /// <value>
// /// Currently unused
// /// </value>
// public long TextureCacheMemoryUsage { get { return textureCacheMemoryUsage; } }
public float TimeDilation { get { return timeDilation; } }
public float SimFps { get { return simFps; } }
@ -123,32 +123,33 @@ namespace OpenSim.Framework.Statistics
public float ActiveScripts { get { return activeScripts; } }
public float ScriptLinesPerSecond { get { return scriptLinesPerSecond; } }
/// <summary>
/// This is the time it took for the last asset request made in response to a cache miss.
/// </summary>
public TimeSpan AssetRequestTimeAfterCacheMiss { get { return assetRequestTimeAfterCacheMiss; } }
/// <summary>
/// Number of persistent requests for missing textures we have started blocking from clients. To some extent
/// this is just a temporary statistic to keep this problem in view - the root cause of this lies either
/// in a mishandling of the reply protocol, related to avatar appearance or may even originate in graphics
/// driver bugs on clients (though this seems less likely).
/// </summary>
public long BlockedMissingTextureRequests { get { return blockedMissingTextureRequests; } }
/// <summary>
/// Record the number of times that an asset request has failed. Failures are effectively exceptions, such as
/// request timeouts. If an asset service replies that a particular asset cannot be found, this is not counted
/// as a failure
/// </summary>
public long AssetServiceRequestFailures { get { return assetServiceRequestFailures; } }
// /// <summary>
// /// This is the time it took for the last asset request made in response to a cache miss.
// /// </summary>
// public TimeSpan AssetRequestTimeAfterCacheMiss { get { return assetRequestTimeAfterCacheMiss; } }
//
// /// <summary>
// /// Number of persistent requests for missing textures we have started blocking from clients. To some extent
// /// this is just a temporary statistic to keep this problem in view - the root cause of this lies either
// /// in a mishandling of the reply protocol, related to avatar appearance or may even originate in graphics
// /// driver bugs on clients (though this seems less likely).
// /// </summary>
// public long BlockedMissingTextureRequests { get { return blockedMissingTextureRequests; } }
//
// /// <summary>
// /// Record the number of times that an asset request has failed. Failures are effectively exceptions, such as
// /// request timeouts. If an asset service replies that a particular asset cannot be found, this is not counted
// /// as a failure
// /// </summary>
// public long AssetServiceRequestFailures { get { return assetServiceRequestFailures; } }
/// <summary>
/// Number of known failures to retrieve avatar inventory from the inventory service. This does not
/// cover situations where the inventory service accepts the request but never returns any data, since
/// we do not yet timeout this situation.
/// </summary>
public long InventoryServiceRetrievalFailures { get { return inventoryServiceRetrievalFailures; } }
/// <remarks>Commented out because we do not cache inventory at this point</remarks>
// public long InventoryServiceRetrievalFailures { get { return inventoryServiceRetrievalFailures; } }
/// <summary>
/// Retrieve the total frame time (in ms) of the last frame
@ -171,58 +172,58 @@ namespace OpenSim.Framework.Statistics
abnormalClientThreadTerminations++;
}
public void AddAsset(AssetBase asset)
{
assetsInCache++;
//assetCacheMemoryUsage += asset.Data.Length;
}
public void RemoveAsset(UUID uuid)
{
assetsInCache--;
}
// public void AddAsset(AssetBase asset)
// {
// assetsInCache++;
// //assetCacheMemoryUsage += asset.Data.Length;
// }
//
// public void RemoveAsset(UUID uuid)
// {
// assetsInCache--;
// }
//
// public void AddTexture(AssetBase image)
// {
// if (image.Data != null)
// {
// texturesInCache++;
//
// // This could have been a pull stat, though there was originally a nebulous idea to measure flow rates
// textureCacheMemoryUsage += image.Data.Length;
// }
// }
//
// /// <summary>
// /// Signal that the asset cache has been cleared.
// /// </summary>
// public void ClearAssetCacheStatistics()
// {
// assetsInCache = 0;
// assetCacheMemoryUsage = 0;
// texturesInCache = 0;
// textureCacheMemoryUsage = 0;
// }
//
// public void AddAssetRequestTimeAfterCacheMiss(TimeSpan ts)
// {
// assetRequestTimeAfterCacheMiss = ts;
// }
//
// public void AddBlockedMissingTextureRequest()
// {
// blockedMissingTextureRequests++;
// }
//
// public void AddAssetServiceRequestFailure()
// {
// assetServiceRequestFailures++;
// }
public void AddTexture(AssetBase image)
{
if (image.Data != null)
{
texturesInCache++;
// This could have been a pull stat, though there was originally a nebulous idea to measure flow rates
textureCacheMemoryUsage += image.Data.Length;
}
}
/// <summary>
/// Signal that the asset cache has been cleared.
/// </summary>
public void ClearAssetCacheStatistics()
{
assetsInCache = 0;
assetCacheMemoryUsage = 0;
texturesInCache = 0;
textureCacheMemoryUsage = 0;
}
public void AddAssetRequestTimeAfterCacheMiss(TimeSpan ts)
{
assetRequestTimeAfterCacheMiss = ts;
}
public void AddBlockedMissingTextureRequest()
{
blockedMissingTextureRequests++;
}
public void AddAssetServiceRequestFailure()
{
assetServiceRequestFailures++;
}
public void AddInventoryServiceRetrievalFailure()
{
inventoryServiceRetrievalFailures++;
}
// public void AddInventoryServiceRetrievalFailure()
// {
// inventoryServiceRetrievalFailures++;
// }
/// <summary>
/// Register as a packet queue stats provider
@ -290,8 +291,8 @@ namespace OpenSim.Framework.Statistics
public override string Report()
{
StringBuilder sb = new StringBuilder(Environment.NewLine);
sb.Append("ASSET STATISTICS");
sb.Append(Environment.NewLine);
// sb.Append("ASSET STATISTICS");
// sb.Append(Environment.NewLine);
/*
sb.Append(
@ -307,7 +308,8 @@ Asset service request failures: {6}"+ Environment.NewLine,
BlockedMissingTextureRequests,
AssetServiceRequestFailures));
*/
/*
sb.Append(
string.Format(
@"Asset cache contains {0,6} assets
@ -318,7 +320,7 @@ Asset service request failures: {3}" + Environment.NewLine,
assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0,
BlockedMissingTextureRequests,
AssetServiceRequestFailures));
*/
sb.Append(Environment.NewLine);
sb.Append("CONNECTION STATISTICS");
@ -328,13 +330,13 @@ Asset service request failures: {3}" + Environment.NewLine,
"Abnormal client thread terminations: {0}" + Environment.NewLine,
abnormalClientThreadTerminations));
sb.Append(Environment.NewLine);
sb.Append("INVENTORY STATISTICS");
sb.Append(Environment.NewLine);
sb.Append(
string.Format(
"Initial inventory caching failures: {0}" + Environment.NewLine,
InventoryServiceRetrievalFailures));
// sb.Append(Environment.NewLine);
// sb.Append("INVENTORY STATISTICS");
// sb.Append(Environment.NewLine);
// sb.Append(
// string.Format(
// "Initial inventory caching failures: {0}" + Environment.NewLine,
// InventoryServiceRetrievalFailures));
sb.Append(Environment.NewLine);
sb.Append("FRAME STATISTICS");
@ -390,17 +392,17 @@ Asset service request failures: {3}" + Environment.NewLine,
public override string XReport(string uptime, string version)
{
OSDMap args = new OSDMap(30);
args["AssetsInCache"] = OSD.FromString (String.Format ("{0:0.##}", AssetsInCache));
args["TimeAfterCacheMiss"] = OSD.FromString (String.Format ("{0:0.##}",
assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0));
args["BlockedMissingTextureRequests"] = OSD.FromString (String.Format ("{0:0.##}",
BlockedMissingTextureRequests));
args["AssetServiceRequestFailures"] = OSD.FromString (String.Format ("{0:0.##}",
AssetServiceRequestFailures));
args["abnormalClientThreadTerminations"] = OSD.FromString (String.Format ("{0:0.##}",
abnormalClientThreadTerminations));
args["InventoryServiceRetrievalFailures"] = OSD.FromString (String.Format ("{0:0.##}",
InventoryServiceRetrievalFailures));
// args["AssetsInCache"] = OSD.FromString (String.Format ("{0:0.##}", AssetsInCache));
// args["TimeAfterCacheMiss"] = OSD.FromString (String.Format ("{0:0.##}",
// assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0));
// args["BlockedMissingTextureRequests"] = OSD.FromString (String.Format ("{0:0.##}",
// BlockedMissingTextureRequests));
// args["AssetServiceRequestFailures"] = OSD.FromString (String.Format ("{0:0.##}",
// AssetServiceRequestFailures));
// args["abnormalClientThreadTerminations"] = OSD.FromString (String.Format ("{0:0.##}",
// abnormalClientThreadTerminations));
// args["InventoryServiceRetrievalFailures"] = OSD.FromString (String.Format ("{0:0.##}",
// InventoryServiceRetrievalFailures));
args["Dilatn"] = OSD.FromString (String.Format ("{0:0.##}", timeDilation));
args["SimFPS"] = OSD.FromString (String.Format ("{0:0.##}", simFps));
args["PhyFPS"] = OSD.FromString (String.Format ("{0:0.##}", physicsFps));

View File

@ -107,15 +107,13 @@ namespace OpenSim
}
else
{
m_log.ErrorFormat("Master ini file {0} not found", masterFilePath);
m_log.ErrorFormat("Master ini file {0} not found", Path.GetFullPath(masterFilePath));
Environment.Exit(1);
}
}
}
string iniFileName =
startupConfig.GetString("inifile", "OpenSim.ini");
string iniFileName = startupConfig.GetString("inifile", "OpenSim.ini");
if (IsUri(iniFileName))
{
@ -131,8 +129,7 @@ namespace OpenSim
if (!File.Exists(Application.iniFilePath))
{
iniFileName = "OpenSim.xml";
Application.iniFilePath = Path.GetFullPath(
Path.Combine(Util.configDir(), iniFileName));
Application.iniFilePath = Path.GetFullPath(Path.Combine(Util.configDir(), iniFileName));
}
if (File.Exists(Application.iniFilePath))
@ -142,15 +139,12 @@ namespace OpenSim
}
}
string iniDirName =
startupConfig.GetString("inidirectory", "config");
string iniDirPath =
Path.Combine(Util.configDir(), iniDirName);
string iniDirName = startupConfig.GetString("inidirectory", "config");
string iniDirPath = Path.Combine(Util.configDir(), iniDirName);
if (Directory.Exists(iniDirPath))
{
m_log.InfoFormat("Searching folder {0} for config ini files",
iniDirPath);
m_log.InfoFormat("Searching folder {0} for config ini files", iniDirPath);
string[] fileEntries = Directory.GetFiles(iniDirName);
foreach (string filePath in fileEntries)
@ -172,7 +166,6 @@ namespace OpenSim
if (sources.Count == 0)
{
m_log.FatalFormat("[CONFIG]: Could not load any configuration");
m_log.FatalFormat("[CONFIG]: Did you copy the OpenSimDefaults.ini.example file to OpenSimDefaults.ini?");
Environment.Exit(1);
}

View File

@ -211,16 +211,16 @@ namespace OpenSim
// Load the simulation data service
IConfig simDataConfig = m_config.Source.Configs["SimulationDataStore"];
if (simDataConfig == null)
throw new Exception("Configuration file is missing the [SimulationDataStore] section");
throw new Exception("Configuration file is missing the [SimulationDataStore] section. Have you copied OpenSim.ini.example to OpenSim.ini to reference config-include/ files?");
string module = simDataConfig.GetString("LocalServiceModule", String.Empty);
if (String.IsNullOrEmpty(module))
throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [SimulationDataStore] section");
throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [SimulationDataStore] section.");
m_simulationDataService = ServerUtils.LoadPlugin<ISimulationDataService>(module, new object[] { m_config.Source });
// Load the estate data service
IConfig estateDataConfig = m_config.Source.Configs["EstateDataStore"];
if (estateDataConfig == null)
throw new Exception("Configuration file is missing the [EstateDataStore] section");
throw new Exception("Configuration file is missing the [EstateDataStore] section. Have you copied OpenSim.ini.example to OpenSim.ini to reference config-include/ files?");
module = estateDataConfig.GetString("LocalServiceModule", String.Empty);
if (String.IsNullOrEmpty(module))
throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section");

View File

@ -492,6 +492,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if ((Environment.TickCount & Int32.MaxValue) - udpClient.TickLastPacketReceived > 1000 * 60)
{
m_log.Warn("[LLUDPSERVER]: Ack timeout, disconnecting " + udpClient.AgentID);
StatsManager.SimExtraStats.AddAbnormalClientThreadTermination();
RemoveClient(udpClient);
return;

View File

@ -1250,6 +1250,24 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
responsemap["7"] = responsearr;
}
if (m_scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero)
{
SceneObjectPart sop = m_scene.GetSceneObjectPart(m_scene.RegionInfo.RegionSettings.TelehubObject);
OSDArray responsearr = new OSDArray();
OSDMap responsemapdata = new OSDMap();
responsemapdata["X"] = OSD.FromInteger((int)(xstart + sop.AbsolutePosition.X));
responsemapdata["Y"] = OSD.FromInteger((int)(ystart + sop.AbsolutePosition.Y));
// responsemapdata["Z"] = OSD.FromInteger((int)m_scene.GetGroundHeight(x,y));
responsemapdata["ID"] = OSD.FromUUID(sop.UUID);
responsemapdata["Name"] = OSD.FromString(sop.Name);
responsemapdata["Extra"] = OSD.FromInteger(0); // color (unused)
responsemapdata["Extra2"] = OSD.FromInteger(0); // 0 = telehub / 1 = infohub
responsearr.Add(responsemapdata);
responsemap["1"] = responsearr;
}
return responsemap;
}

View File

@ -66,12 +66,9 @@ namespace OpenSim.Region.Framework.Scenes
protected internal event PhysicsCrash UnRecoverableError;
private PhysicsCrash handlerPhysicsCrash = null;
public event ObjectDuplicateDelegate OnObjectDuplicate;
public event AttachToBackupDelegate OnAttachToBackup;
public event DetachFromBackupDelegate OnDetachFromBackup;
public event ChangedBackupDelegate OnChangeBackup;
public event ObjectCreateDelegate OnObjectCreate;
public event ObjectDeleteDelegate OnObjectRemove;
#endregion
@ -445,9 +442,6 @@ namespace OpenSim.Region.Framework.Scenes
if (attachToBackup)
sceneObject.AttachToBackup();
if (OnObjectCreate != null)
OnObjectCreate(sceneObject);
lock (SceneObjectGroupsByFullID)
SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
@ -496,9 +490,6 @@ namespace OpenSim.Region.Framework.Scenes
if ((grp.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics)
RemovePhysicalPrim(grp.PrimCount);
}
if (OnObjectRemove != null)
OnObjectRemove(Entities[uuid]);
lock (SceneObjectGroupsByFullID)
SceneObjectGroupsByFullID.Remove(grp.UUID);
@ -2091,9 +2082,6 @@ namespace OpenSim.Region.Framework.Scenes
// required for physics to update it's position
copy.AbsolutePosition = copy.AbsolutePosition;
if (OnObjectDuplicate != null)
OnObjectDuplicate(original, copy);
return copy;
}
}

View File

@ -88,7 +88,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
(mod, cmd) => MainConsole.Instance.Output(HandleImageQueuesClear(cmd)));
scene.AddCommand(
this, "show image queues",
this, "image queues show",
"image queues show <first-name> <last-name>",
"Show the image queues (textures downloaded via UDP) for a particular client.",
(mod, cmd) => MainConsole.Instance.Output(GetImageQueuesReport(cmd)));
@ -293,7 +293,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
private string GetImageQueuesReport(string[] showParams)
{
if (showParams.Length < 5 || showParams.Length > 6)
return "Usage: show image queues <first-name> <last-name> [full]";
return "Usage: image queues show <first-name> <last-name> [full]";
string firstName = showParams[3];
string lastName = showParams[4];

View File

@ -134,9 +134,18 @@ namespace OpenSim.Region.Physics.OdePlugin
| CollisionCategories.Body
| CollisionCategories.Character
| CollisionCategories.Land);
internal IntPtr Body = IntPtr.Zero;
/// <summary>
/// Body for dynamics simulation
/// </summary>
internal IntPtr Body { get; private set; }
private OdeScene _parent_scene;
internal IntPtr Shell = IntPtr.Zero;
/// <summary>
/// Collision geometry
/// </summary>
internal IntPtr Shell { get; private set; }
private IntPtr Amotor = IntPtr.Zero;
private d.Mass ShellMass;
@ -1018,6 +1027,13 @@ namespace OpenSim.Region.Physics.OdePlugin
/// <param name="tensor"></param>
private void CreateOdeStructures(float npositionX, float npositionY, float npositionZ, float tensor)
{
if (!(Shell == IntPtr.Zero && Body == IntPtr.Zero && Amotor == IntPtr.Zero))
{
m_log.ErrorFormat(
"[ODE CHARACTER]: Creating ODE structures for {0} even though some already exist. Shell = {1}, Body = {2}, Amotor = {3}",
Name, Shell, Body, Amotor);
}
int dAMotorEuler = 1;
// _parent_scene.waitForSpaceUnlock(_parent_scene.space);
if (CAPSULE_LENGTH <= 0)
@ -1135,6 +1151,14 @@ namespace OpenSim.Region.Physics.OdePlugin
/// </summary>
internal void DestroyOdeStructures()
{
// Create avatar capsule and related ODE data
if (Shell == IntPtr.Zero || Body == IntPtr.Zero || Amotor == IntPtr.Zero)
{
m_log.ErrorFormat(
"[ODE CHARACTER]: Destroying ODE structures for {0} even though some are already null. Shell = {1}, Body = {2}, Amotor = {3}",
Name, Shell, Body, Amotor);
}
// destroy avatar capsule and related ODE data
if (Amotor != IntPtr.Zero)
{
@ -1260,15 +1284,6 @@ namespace OpenSim.Region.Physics.OdePlugin
{
if (m_tainted_isPhysical)
{
// Create avatar capsule and related ODE data
if (!(Shell == IntPtr.Zero && Body == IntPtr.Zero && Amotor == IntPtr.Zero))
{
m_log.Warn("[ODE CHARACTER]: re-creating the following avatar ODE data for " + Name + ", even though it already exists - "
+ (Shell!=IntPtr.Zero ? "Shell ":"")
+ (Body!=IntPtr.Zero ? "Body ":"")
+ (Amotor!=IntPtr.Zero ? "Amotor ":""));
}
CreateOdeStructures(_position.X, _position.Y, _position.Z, m_tensor);
_parent_scene.AddCharacter(this);
}

View File

@ -1525,7 +1525,7 @@ namespace OpenSim.Region.Physics.OdePlugin
chr.CollidingGround = false;
chr.CollidingObj = false;
// test the avatar's geometry for collision with the space
// Test the avatar's geometry for collision with the space
// This will return near and the space that they are the closest to
// And we'll run this again against the avatar and the space segment
// This will return with a bunch of possible objects in the space segment

View File

@ -126,11 +126,10 @@ namespace OpenSim.Server.Base
m_Config = new IniConfigSource(iniFile);
}
}
catch (Exception)
catch (Exception e)
{
System.Console.WriteLine("Error reading from config source {0}",
iniFile);
Thread.CurrentThread.Abort();
System.Console.WriteLine("Error reading from config source. {0}", e.Message);
Environment.Exit(1);
}
// Merge the configuration from the command line into the