From 8b035dc3c7ec88ec2c715ebaad9c3de5a34078b5 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 24 Jan 2012 18:46:24 +0000 Subject: [PATCH 1/8] Restrict accessible of ODECharacter Shell and Body. Add method doc and some error log lines. --- .../Region/Physics/OdePlugin/ODECharacter.cs | 37 +++++++++++++------ OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 2 +- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 68999fc283..c6e82868b4 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -134,9 +134,18 @@ namespace OpenSim.Region.Physics.OdePlugin | CollisionCategories.Body | CollisionCategories.Character | CollisionCategories.Land); - internal IntPtr Body = IntPtr.Zero; + /// + /// Body for dynamics simulation + /// + internal IntPtr Body { get; private set; } + private OdeScene _parent_scene; - internal IntPtr Shell = IntPtr.Zero; + + /// + /// Collision geometry + /// + internal IntPtr Shell { get; private set; } + private IntPtr Amotor = IntPtr.Zero; private d.Mass ShellMass; @@ -1018,6 +1027,13 @@ namespace OpenSim.Region.Physics.OdePlugin /// 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 /// 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); } diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 228eca9896..37daf46dfb 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -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 From 7e76397a264042e772855be5245b64b35336744a Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 24 Jan 2012 20:54:35 +0000 Subject: [PATCH 2/8] minor: correct text and usage for "image queues show" reigon console command. --- .../OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs index 95aa864de6..261029c091 100644 --- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs @@ -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 ", "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 [full]"; + return "Usage: image queues show [full]"; string firstName = showParams[3]; string lastName = showParams[4]; From 488fe0ae9c8cadd1abe4a643f61a6a9c7e18e34d Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Tue, 24 Jan 2012 13:41:26 -0800 Subject: [PATCH 3/8] Removed unused events in SceneGraph: OnObjectCreate, OnObjectRemove, OnObjectDuplicate --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 1e2901b835..1af8346fe0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -60,10 +60,6 @@ namespace OpenSim.Region.Framework.Scenes protected internal event PhysicsCrash UnRecoverableError; private PhysicsCrash handlerPhysicsCrash = null; - public event ObjectDuplicateDelegate OnObjectDuplicate; - public event ObjectCreateDelegate OnObjectCreate; - public event ObjectDeleteDelegate OnObjectRemove; - #endregion #region Fields @@ -404,9 +400,6 @@ namespace OpenSim.Region.Framework.Scenes if (attachToBackup) sceneObject.AttachToBackup(); - if (OnObjectCreate != null) - OnObjectCreate(sceneObject); - lock (SceneObjectGroupsByFullID) SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; @@ -455,9 +448,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); @@ -1979,9 +1969,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; } } From e8f1e7e96e59ede55dbeb949b28980c4be1dd456 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 24 Jan 2012 22:03:30 +0000 Subject: [PATCH 4/8] Comment out inventory statistics section from periodic stats, since this only contained the now uncollected and irrelevant inventory cache number. --- .../Statistics/SimExtraStatsCollector.cs | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs index 544975791b..3035a626a7 100644 --- a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs @@ -148,7 +148,8 @@ namespace OpenSim.Framework.Statistics /// cover situations where the inventory service accepts the request but never returns any data, since /// we do not yet timeout this situation. /// - public long InventoryServiceRetrievalFailures { get { return inventoryServiceRetrievalFailures; } } + /// Commented out because we do not cache inventory at this point +// public long InventoryServiceRetrievalFailures { get { return inventoryServiceRetrievalFailures; } } /// /// Retrieve the total frame time (in ms) of the last frame @@ -219,10 +220,10 @@ namespace OpenSim.Framework.Statistics assetServiceRequestFailures++; } - public void AddInventoryServiceRetrievalFailure() - { - inventoryServiceRetrievalFailures++; - } +// public void AddInventoryServiceRetrievalFailure() +// { +// inventoryServiceRetrievalFailures++; +// } /// /// Register as a packet queue stats provider @@ -328,13 +329,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"); @@ -399,8 +400,8 @@ Asset service request failures: {3}" + Environment.NewLine, AssetServiceRequestFailures)); args["abnormalClientThreadTerminations"] = OSD.FromString (String.Format ("{0:0.##}", abnormalClientThreadTerminations)); - args["InventoryServiceRetrievalFailures"] = OSD.FromString (String.Format ("{0:0.##}", - InventoryServiceRetrievalFailures)); +// 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)); From 5e445aaf7b134f51bfdb78a965e55395eca8bad9 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 24 Jan 2012 22:09:13 +0000 Subject: [PATCH 5/8] Fix "Abnormal client thread terminations" stat in period CONNECTION STATISTICS to count the number of times clients are disconnected due to ack timeouts. This has been broken for a long period and would only ever show 0. --- OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 5610c099eb..7b1aa2cf90 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -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; From dc329202ef577d8c544eecd156ba496d7e680f0a Mon Sep 17 00:00:00 2001 From: BlueWall Date: Tue, 24 Jan 2012 17:11:35 -0500 Subject: [PATCH 6/8] Put Telehubs on the map --- .../World/WorldMap/WorldMapModule.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 9b0e2ffc79..2f723ef804 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -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; } From 09baa3e679e9f3719a7fa533a31ebe2a2e75743a Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 24 Jan 2012 22:14:21 +0000 Subject: [PATCH 7/8] Comment out asset statistics section from periodic stats as these have not been recorded for a very long time. Some might make a comeback in the future but others are of dubious usefuless for health check purposes, or the complexity of collection outweighs their usefulness. Some data is available via other means (e.g. "fcache status"). --- .../Statistics/SimExtraStatsCollector.cs | 217 +++++++++--------- 1 file changed, 109 insertions(+), 108 deletions(-) diff --git a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs index 3035a626a7..a506e3ba4d 100644 --- a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs @@ -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 /// public long AbnormalClientThreadTerminations { get { return abnormalClientThreadTerminations; } } - /// - /// 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... - /// - public long AssetsInCache { get { return assetsInCache; } } - - /// - /// Currently unused - /// - public long TexturesInCache { get { return texturesInCache; } } - - /// - /// Currently misleading since we can't currently subtract removed asset memory usage without a performance hit - /// - public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } } - - /// - /// Currently unused - /// - public long TextureCacheMemoryUsage { get { return textureCacheMemoryUsage; } } +// /// +// /// 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... +// /// +// public long AssetsInCache { get { return assetsInCache; } } +// +// /// +// /// Currently unused +// /// +// public long TexturesInCache { get { return texturesInCache; } } +// +// /// +// /// Currently misleading since we can't currently subtract removed asset memory usage without a performance hit +// /// +// public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } } +// +// /// +// /// Currently unused +// /// +// public long TextureCacheMemoryUsage { get { return textureCacheMemoryUsage; } } public float TimeDilation { get { return timeDilation; } } public float SimFps { get { return simFps; } } @@ -123,25 +123,25 @@ namespace OpenSim.Framework.Statistics public float ActiveScripts { get { return activeScripts; } } public float ScriptLinesPerSecond { get { return scriptLinesPerSecond; } } - /// - /// This is the time it took for the last asset request made in response to a cache miss. - /// - public TimeSpan AssetRequestTimeAfterCacheMiss { get { return assetRequestTimeAfterCacheMiss; } } - - /// - /// 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). - /// - public long BlockedMissingTextureRequests { get { return blockedMissingTextureRequests; } } - - /// - /// 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 - /// - public long AssetServiceRequestFailures { get { return assetServiceRequestFailures; } } +// /// +// /// This is the time it took for the last asset request made in response to a cache miss. +// /// +// public TimeSpan AssetRequestTimeAfterCacheMiss { get { return assetRequestTimeAfterCacheMiss; } } +// +// /// +// /// 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). +// /// +// public long BlockedMissingTextureRequests { get { return blockedMissingTextureRequests; } } +// +// /// +// /// 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 +// /// +// public long AssetServiceRequestFailures { get { return assetServiceRequestFailures; } } /// /// Number of known failures to retrieve avatar inventory from the inventory service. This does not @@ -172,53 +172,53 @@ namespace OpenSim.Framework.Statistics abnormalClientThreadTerminations++; } - 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; - } - } - - /// - /// Signal that the asset cache has been cleared. - /// - 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 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; +// } +// } +// +// /// +// /// Signal that the asset cache has been cleared. +// /// +// 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() // { @@ -291,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( @@ -308,7 +308,8 @@ Asset service request failures: {6}"+ Environment.NewLine, BlockedMissingTextureRequests, AssetServiceRequestFailures)); */ - + + /* sb.Append( string.Format( @"Asset cache contains {0,6} assets @@ -319,7 +320,7 @@ Asset service request failures: {3}" + Environment.NewLine, assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0, BlockedMissingTextureRequests, AssetServiceRequestFailures)); - + */ sb.Append(Environment.NewLine); sb.Append("CONNECTION STATISTICS"); @@ -391,15 +392,15 @@ 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["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)); From 2d0412d366c1c243cc3abfe753f21d59b4c55473 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 24 Jan 2012 22:35:55 +0000 Subject: [PATCH 8/8] Make errors reported by OpenSim when it halts because it can't find certain config sections or files a bit more user friendly. --- .../Region/Application/ConfigurationLoader.cs | 19 ++++++------------- OpenSim/Region/Application/OpenSimBase.cs | 6 +++--- OpenSim/Server/Base/ServicesServerBase.cs | 7 +++---- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index 4a7c8b083b..8d95c41ca2 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs @@ -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); } diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 9f9b4f04e1..a680a59cba 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -202,16 +202,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(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"); diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs index aeba35ff1c..a6f4e4769e 100644 --- a/OpenSim/Server/Base/ServicesServerBase.cs +++ b/OpenSim/Server/Base/ServicesServerBase.cs @@ -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