* possible fix for event queue problems (exceptions and event count max exceeded issues) seen in osgrid meeting today

* From the logs, I'm guessing probable cause is that an exception generated by a bad index given to substring error line number conversion stopped the script being killed, leading to continuous events that filled up the log (maybe)
* Someone will need to go back and fix this properly
0.6.0-stable
Justin Clarke Casey 2008-08-05 20:47:36 +00:00
parent 6b1a5c33af
commit 200c77ad15
1 changed files with 17 additions and 1 deletions

View File

@ -27,9 +27,11 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Reflection;
using System.Threading; using System.Threading;
using System.Globalization; using System.Globalization;
using libsecondlife; using libsecondlife;
using log4net;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Region.Environment.Scenes.Scripting; using OpenSim.Region.Environment.Scenes.Scripting;
@ -40,6 +42,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
/// </summary> /// </summary>
public class EventQueueThreadClass : iScriptEngineFunctionModule public class EventQueueThreadClass : iScriptEngineFunctionModule
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// How many ms to sleep if queue is empty /// How many ms to sleep if queue is empty
/// </summary> /// </summary>
@ -313,7 +317,19 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
{ {
// Not sure why this is converted to an int then back to a string, either // Not sure why this is converted to an int then back to a string, either
// way, need to skip the word "line " in the substring // way, need to skip the word "line " in the substring
try
{
line = " at line " + Convert.ToInt32(t.Substring(colon + 6)).ToString(); line = " at line " + Convert.ToInt32(t.Substring(colon + 6)).ToString();
}
catch (ArgumentOutOfRangeException e)
{
// FIXME: Big fat temporary patch to stop the Substring above throwing an exception
// and stopping a proper kill of the script. We're making an unwarranted assumption
// about the size of t. This needs to be fixed properly.
m_log.ErrorFormat("[SCRIPT ENGINE]: Line number conversion exception {0}", e);
line = " at line (unavailable)";
}
break; break;
} }
} }