Merge branch 'master' into httptests

httptests
UbitUmarov 2017-05-27 05:47:05 +01:00
commit c54985f8a1
20 changed files with 197 additions and 208 deletions

View File

@ -136,12 +136,15 @@ namespace OpenSim.Framework.Monitoring
if(m_jobQueue.Count <= 0) if(m_jobQueue.Count <= 0)
m_cancelSource.Cancel(); m_cancelSource.Cancel();
if(m_finishedProcessingAfterStop.WaitOne(RequestProcessTimeoutOnStop)) m_finishedProcessingAfterStop.WaitOne(RequestProcessTimeoutOnStop);
m_finishedProcessingAfterStop.Close(); m_finishedProcessingAfterStop.Close();
} }
finally finally
{ {
m_cancelSource.Dispose(); if(m_cancelSource != null)
m_cancelSource.Dispose();
if(m_finishedProcessingAfterStop != null)
m_finishedProcessingAfterStop.Dispose();
} }
} }
} }

View File

@ -341,6 +341,8 @@ namespace OpenSim.Framework.Monitoring
/// <param name="e"></param> /// <param name="e"></param>
private static void WatchdogTimerElapsed(object sender, System.Timers.ElapsedEventArgs e) private static void WatchdogTimerElapsed(object sender, System.Timers.ElapsedEventArgs e)
{ {
if(!m_enabled)
return;
int now = Environment.TickCount & Int32.MaxValue; int now = Environment.TickCount & Int32.MaxValue;
int msElapsed = now - LastWatchdogThreadTick; int msElapsed = now - LastWatchdogThreadTick;
@ -358,21 +360,26 @@ namespace OpenSim.Framework.Monitoring
List<ThreadWatchdogInfo> callbackInfos = null; List<ThreadWatchdogInfo> callbackInfos = null;
List<ThreadWatchdogInfo> threadsToRemove = null; List<ThreadWatchdogInfo> threadsToRemove = null;
const ThreadState thgone = ThreadState.Stopped | ThreadState.Aborted | ThreadState.AbortRequested;
lock (m_threads) lock (m_threads)
{ {
foreach(ThreadWatchdogInfo threadInfo in m_threads.Values) foreach(ThreadWatchdogInfo threadInfo in m_threads.Values)
{ {
if(threadInfo.Thread.ThreadState == ThreadState.Stopped) if(!m_enabled)
return;
if(!threadInfo.Thread.IsAlive || (threadInfo.Thread.ThreadState & thgone) != 0)
{ {
if(threadsToRemove == null) if(threadsToRemove == null)
threadsToRemove = new List<ThreadWatchdogInfo>(); threadsToRemove = new List<ThreadWatchdogInfo>();
threadsToRemove.Add(threadInfo); threadsToRemove.Add(threadInfo);
/*
if(callbackInfos == null) if(callbackInfos == null)
callbackInfos = new List<ThreadWatchdogInfo>(); callbackInfos = new List<ThreadWatchdogInfo>();
callbackInfos.Add(threadInfo); callbackInfos.Add(threadInfo);
*/
} }
else if(!threadInfo.IsTimedOut && now - threadInfo.LastTick >= threadInfo.Timeout) else if(!threadInfo.IsTimedOut && now - threadInfo.LastTick >= threadInfo.Timeout)
{ {

View File

@ -420,6 +420,7 @@ namespace OpenSim.Framework
set { m_remotingPort = value; } set { m_remotingPort = value; }
} }
/// <value> /// <value>
/// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw. /// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw.
/// ///
@ -427,42 +428,7 @@ namespace OpenSim.Framework
/// </value> /// </value>
public IPEndPoint ExternalEndPoint public IPEndPoint ExternalEndPoint
{ {
get get { return Util.getEndPoint(m_externalHostName, m_internalEndPoint.Port); }
{
// Old one defaults to IPv6
//return new IPEndPoint(Dns.GetHostAddresses(m_externalHostName)[0], m_internalEndPoint.Port);
IPAddress ia = null;
// If it is already an IP, don't resolve it - just return directly
if (IPAddress.TryParse(m_externalHostName, out ia))
return new IPEndPoint(ia, m_internalEndPoint.Port);
// Reset for next check
ia = null;
try
{
foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName))
{
if (ia == null)
ia = Adr;
if (Adr.AddressFamily == AddressFamily.InterNetwork)
{
ia = Adr;
break;
}
}
}
catch (SocketException e)
{
throw new Exception(
"Unable to resolve local hostname " + m_externalHostName + " innerException of type '" +
e + "' attached to this exception", e);
}
return new IPEndPoint(ia, m_internalEndPoint.Port);
}
set { m_externalHostName = value.ToString(); } set { m_externalHostName = value.ToString(); }
} }

View File

@ -429,6 +429,65 @@ namespace OpenSim.Framework
return regionCoord << 8; return regionCoord << 8;
} }
public static IPEndPoint getEndPoint(IPAddress ia, int port)
{
if(ia == null)
return null;
IPEndPoint newEP = null;
try
{
newEP = new IPEndPoint(ia, port);
}
catch
{
newEP = null;
}
return newEP;
}
public static IPEndPoint getEndPoint(string hostname, int port)
{
IPAddress ia = null;
// If it is already an IP, don't resolve it - just return directly
// we should not need this
if (IPAddress.TryParse(hostname, out ia))
{
if (ia.Equals(IPAddress.Any) || ia.Equals(IPAddress.IPv6Any))
return null;
return getEndPoint(ia, port);
}
// Reset for next check
ia = null;
try
{
foreach (IPAddress Adr in Dns.GetHostAddresses(hostname))
{
if (ia == null)
ia = Adr;
if (Adr.AddressFamily == AddressFamily.InterNetwork)
{
ia = Adr;
break;
}
}
}
catch // (SocketException e)
{
/*throw new Exception(
"Unable to resolve local hostname " + m_externalHostName + " innerException of type '" +
e + "' attached to this exception", e);*/
// Don't throw a fatal exception here, instead, return Null and handle it in the caller.
// Reason is, on systems such as OSgrid it has occured that known hostnames stop
// resolving and thus make surrounding regions crash out with this exception.
return null;
}
return getEndPoint(ia,port);
}
public static bool checkServiceURI(string uristr, out string serviceURI) public static bool checkServiceURI(string uristr, out string serviceURI)
{ {
serviceURI = string.Empty; serviceURI = string.Empty;

View File

@ -511,8 +511,6 @@ namespace OpenSim
private void WatchdogTimeoutHandler(Watchdog.ThreadWatchdogInfo twi) private void WatchdogTimeoutHandler(Watchdog.ThreadWatchdogInfo twi)
{ {
int now = Environment.TickCount & Int32.MaxValue; int now = Environment.TickCount & Int32.MaxValue;
if(twi.Thread.ThreadState == System.Threading.ThreadState.Stopped)
return;
m_log.ErrorFormat( m_log.ErrorFormat(
"[WATCHDOG]: Timeout detected for thread \"{0}\". ThreadState={1}. Last tick was {2}ms ago. {3}", "[WATCHDOG]: Timeout detected for thread \"{0}\". ThreadState={1}. Last tick was {2}ms ago. {3}",
twi.Thread.Name, twi.Thread.Name,

View File

@ -203,10 +203,10 @@ namespace OpenSim.Region.ClientStack.Linden
{ {
while(true) while(true)
{ {
aPollRequest poolreq = m_queue.Dequeue(1000); aPollRequest poolreq = m_queue.Dequeue(4500);
Watchdog.UpdateThread();
if(m_NumberScenes <= 0) if(m_NumberScenes <= 0)
return; return;
Watchdog.UpdateThread();
if(poolreq.reqID != UUID.Zero) if(poolreq.reqID != UUID.Zero)
poolreq.thepoll.Process(poolreq); poolreq.thepoll.Process(poolreq);
} }

View File

@ -445,10 +445,10 @@ namespace OpenSim.Region.ClientStack.Linden
{ {
while (true) while (true)
{ {
aPollRequest poolreq = m_queue.Dequeue(2000); aPollRequest poolreq = m_queue.Dequeue(4500);
Watchdog.UpdateThread();
if(m_NumberScenes <= 0) if(m_NumberScenes <= 0)
return; return;
Watchdog.UpdateThread();
if(poolreq.reqID != UUID.Zero) if(poolreq.reqID != UUID.Zero)
poolreq.thepoll.Process(poolreq); poolreq.thepoll.Process(poolreq);
} }

View File

@ -479,10 +479,9 @@ namespace OpenSim.Region.ClientStack.Linden
{ {
while (true) while (true)
{ {
aPollRequest poolreq = m_queue.Dequeue(4500);
Watchdog.UpdateThread(); Watchdog.UpdateThread();
aPollRequest poolreq = m_queue.Dequeue(5000);
if (poolreq != null && poolreq.thepoll != null) if (poolreq != null && poolreq.thepoll != null)
{ {
try try

View File

@ -646,7 +646,7 @@ namespace OpenSim.Region.CoreModules.Asset
if (m_LogLevel >= 2) if (m_LogLevel >= 2)
m_log.Debug("[FLOTSAM ASSET CACHE]: Clearing caches."); m_log.Debug("[FLOTSAM ASSET CACHE]: Clearing caches.");
if (m_FileCacheEnabled) if (m_FileCacheEnabled && Directory.Exists(m_CacheDirectory))
{ {
foreach (string dir in Directory.GetDirectories(m_CacheDirectory)) foreach (string dir in Directory.GetDirectories(m_CacheDirectory))
{ {
@ -681,10 +681,10 @@ namespace OpenSim.Region.CoreModules.Asset
// before cleaning up expired files we must scan the objects in the scene to make sure that we retain // before cleaning up expired files we must scan the objects in the scene to make sure that we retain
// such local assets if they have not been recently accessed. // such local assets if they have not been recently accessed.
TouchAllSceneAssets(false); TouchAllSceneAssets(false);
if(Directory.Exists(m_CacheDirectory))
foreach (string dir in Directory.GetDirectories(m_CacheDirectory))
{ {
CleanExpiredFiles(dir, purgeLine); foreach (string dir in Directory.GetDirectories(m_CacheDirectory))
CleanExpiredFiles(dir, purgeLine);
} }
lock(timerLock) lock(timerLock)
@ -706,6 +706,9 @@ namespace OpenSim.Region.CoreModules.Asset
{ {
try try
{ {
if(!Directory.Exists(dir))
return;
foreach (string file in Directory.GetFiles(dir)) foreach (string file in Directory.GetFiles(dir))
{ {
if (File.GetLastAccessTime(file) < purgeLine) if (File.GetLastAccessTime(file) < purgeLine)
@ -869,6 +872,9 @@ namespace OpenSim.Region.CoreModules.Asset
/// <returns></returns> /// <returns></returns>
private int GetFileCacheCount(string dir) private int GetFileCacheCount(string dir)
{ {
if(!Directory.Exists(dir))
return 0;
int count = Directory.GetFiles(dir).Length; int count = Directory.GetFiles(dir).Length;
foreach (string subdir in Directory.GetDirectories(dir)) foreach (string subdir in Directory.GetDirectories(dir))
@ -987,6 +993,9 @@ namespace OpenSim.Region.CoreModules.Asset
/// </summary> /// </summary>
private void ClearFileCache() private void ClearFileCache()
{ {
if(!Directory.Exists(m_CacheDirectory))
return;
foreach (string dir in Directory.GetDirectories(m_CacheDirectory)) foreach (string dir in Directory.GetDirectories(m_CacheDirectory))
{ {
try try

View File

@ -658,7 +658,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
public void Process() public void Process()
{ {
_finished = false; _finished = false;
httpThread = WorkManager.StartThread(SendRequest, "HttpRequestThread", ThreadPriority.BelowNormal, true, false); httpThread = WorkManager.StartThread(SendRequest, "HttpRequestThread", ThreadPriority.BelowNormal, true, false, null, int.MaxValue);
} }
/* /*

View File

@ -385,7 +385,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
storage[handle] = region; storage[handle] = region;
byname[region.RegionName] = handle; byname[region.RegionName] = handle;
byuuid[region.RegionID] = handle; byuuid[region.RegionID] = handle;
} }
public void Remove(GridRegion region) public void Remove(GridRegion region)
@ -400,7 +399,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
ulong handle = region.RegionHandle & HANDLEMASK; ulong handle = region.RegionHandle & HANDLEMASK;
if(storage != null) if(storage != null)
storage.Remove(handle); {
if(storage.ContainsKey(handle))
{
storage[handle] = null;
storage.Remove(handle);
}
}
removeFromInner(region); removeFromInner(region);
if(expires != null) if(expires != null)
{ {
@ -424,6 +429,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
if(byuuid != null) if(byuuid != null)
byuuid.Remove(r.RegionID); byuuid.Remove(r.RegionID);
removeFromInner(r); removeFromInner(r);
storage[handle] = null;
} }
storage.Remove(handle); storage.Remove(handle);
} }
@ -582,26 +588,31 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
if(expires == null || expires.Count == 0) if(expires == null || expires.Count == 0)
return 0; return 0;
int expiresCount = expires.Count;
List<ulong> toexpire = new List<ulong>(); List<ulong> toexpire = new List<ulong>();
foreach(KeyValuePair<ulong, DateTime> kvp in expires) foreach(KeyValuePair<ulong, DateTime> kvp in expires)
{ {
if(kvp.Value < now) if(kvp.Value < now)
toexpire.Add(kvp.Key); toexpire.Add(kvp.Key);
} }
if(toexpire.Count == 0) int toexpireCount = toexpire.Count;
return expires.Count; if(toexpireCount == 0)
return expiresCount;
if(toexpire.Count == expires.Count) if(toexpireCount == expiresCount)
{ {
Clear(); Clear();
return 0; return 0;
} }
foreach(ulong h in toexpire) if(storage != null)
{ {
if(storage != null) ulong h;
for(int i = 0; i < toexpireCount; i++)
{ {
h = toexpire[i];
if(storage.ContainsKey(h)) if(storage.ContainsKey(h))
{ {
GridRegion r = storage[h]; GridRegion r = storage[h];
@ -610,14 +621,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
if(byuuid != null) if(byuuid != null)
byuuid.Remove(r.RegionID); byuuid.Remove(r.RegionID);
removeFromInner(r); removeFromInner(r);
storage[h] = null;
storage.Remove(h);
} }
storage.Remove(h); if(expires != null)
expires.Remove(h);
} }
if(expires != null) }
expires.Remove(h); else
{
Clear();
return 0;
} }
if(expires.Count == 0) expiresCount = expires.Count;
if(expiresCount == 0)
{ {
byname = null; byname = null;
byuuid = null; byuuid = null;
@ -626,7 +645,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
return 0; return 0;
} }
return expires.Count; return expiresCount;
} }
public int Count() public int Count()
@ -693,7 +712,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
public class RegionsExpiringCache public class RegionsExpiringCache
{ {
const double CACHE_PURGE_HZ = 60; // seconds const double CACHE_PURGE_TIME = 60000; // milliseconds
const int MAX_LOCK_WAIT = 10000; // milliseconds const int MAX_LOCK_WAIT = 10000; // milliseconds
/// <summary>For thread safety</summary> /// <summary>For thread safety</summary>
@ -702,7 +721,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
object isPurging = new object(); object isPurging = new object();
Dictionary<UUID, RegionInfoForScope> InfobyScope = new Dictionary<UUID, RegionInfoForScope>(); Dictionary<UUID, RegionInfoForScope> InfobyScope = new Dictionary<UUID, RegionInfoForScope>();
private System.Timers.Timer timer = new System.Timers.Timer(TimeSpan.FromSeconds(CACHE_PURGE_HZ).TotalMilliseconds); private System.Timers.Timer timer = new System.Timers.Timer(CACHE_PURGE_TIME);
public RegionsExpiringCache() public RegionsExpiringCache()
{ {
@ -965,7 +984,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
if (expiredscopes.Count > 0) if (expiredscopes.Count > 0)
{ {
foreach (UUID sid in expiredscopes) foreach (UUID sid in expiredscopes)
{
InfobyScope[sid] = null;
InfobyScope.Remove(sid); InfobyScope.Remove(sid);
}
} }
} }
finally { Monitor.Exit(syncRoot); } finally { Monitor.Exit(syncRoot); }

View File

@ -716,12 +716,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
{ {
while (true) while (true)
{ {
Watchdog.UpdateThread();
av = null; av = null;
st = null; st = null;
st = requests.Dequeue(4900); // timeout to make watchdog happy st = requests.Dequeue(4500);
Watchdog.UpdateThread();
if (st == null || st.agentID == UUID.Zero) if (st == null || st.agentID == UUID.Zero)
continue; continue;
@ -1152,10 +1151,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
{ {
while(!m_mapBlockRequestEvent.WaitOne(4900)) while(!m_mapBlockRequestEvent.WaitOne(4900))
{ {
Watchdog.UpdateThread();
if(m_scene == null) if(m_scene == null)
return; return;
} }
Watchdog.UpdateThread();
lock (m_mapBlockRequestEvent) lock (m_mapBlockRequestEvent)
{ {
int total = 0; int total = 0;

View File

@ -226,9 +226,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
try try
{ {
Thread.Sleep(cmdHandlerThreadCycleSleepms); Thread.Sleep(cmdHandlerThreadCycleSleepms);
Watchdog.UpdateThread();
DoOneCmdHandlerPass(); DoOneCmdHandlerPass();
Watchdog.UpdateThread(); Watchdog.UpdateThread();
} }
catch ( System.Threading.ThreadAbortException) { } catch ( System.Threading.ThreadAbortException) { }

View File

@ -79,12 +79,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
private List<string> m_warnings = new List<string>(); private List<string> m_warnings = new List<string>();
// private object m_syncy = new object();
// private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider();
// private static VBCodeProvider VBcodeProvider = new VBCodeProvider();
// private static int instanceID = new Random().Next(0, int.MaxValue); // Unique number to use on our compiled files
private static UInt64 scriptCompileCounter = 0; // And a counter private static UInt64 scriptCompileCounter = 0; // And a counter
public IScriptEngine m_scriptEngine; public IScriptEngine m_scriptEngine;
@ -251,23 +245,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
} }
} }
////private ICodeCompiler icc = codeProvider.CreateCompiler();
//public string CompileFromFile(string LSOFileName)
//{
// switch (Path.GetExtension(LSOFileName).ToLower())
// {
// case ".txt":
// case ".lsl":
// Common.ScriptEngineBase.Shared.SendToDebug("Source code is LSL, converting to CS");
// return CompileFromLSLText(File.ReadAllText(LSOFileName));
// case ".cs":
// Common.ScriptEngineBase.Shared.SendToDebug("Source code is CS");
// return CompileFromCSText(File.ReadAllText(LSOFileName));
// default:
// throw new Exception("Unknown script type.");
// }
//}
public string GetCompilerOutput(string assetID) public string GetCompilerOutput(string assetID)
{ {
return Path.Combine(ScriptEnginesPath, Path.Combine( return Path.Combine(ScriptEnginesPath, Path.Combine(
@ -578,8 +555,6 @@ namespace SecondLife
switch (lang) switch (lang)
{ {
case enumCompileType.vb: case enumCompileType.vb:
// results = VBcodeProvider.CompileAssemblyFromSource(
// parameters, Script);
provider = CodeDomProvider.CreateProvider("VisualBasic"); provider = CodeDomProvider.CreateProvider("VisualBasic");
break; break;
case enumCompileType.cs: case enumCompileType.cs:
@ -594,56 +569,36 @@ namespace SecondLife
if(provider == null) if(provider == null)
throw new Exception("Compiler failed to load "); throw new Exception("Compiler failed to load ");
bool complete = false;
bool retried = false;
bool complete = false; do
bool retried = false; {
results = provider.CompileAssemblyFromSource(
do parameters, Script);
// Deal with an occasional segv in the compiler.
// Rarely, if ever, occurs twice in succession.
// Line # == 0 and no file name are indications that
// this is a native stack trace rather than a normal
// error log.
if (results.Errors.Count > 0)
{
if (!retried && string.IsNullOrEmpty(results.Errors[0].FileName) &&
results.Errors[0].Line == 0)
{ {
// lock (CScodeProvider) // System.Console.WriteLine("retrying failed compilation");
// { retried = true;
// results = CScodeProvider.CompileAssemblyFromSource( }
// parameters, Script); else
// } {
complete = true;
results = provider.CompileAssemblyFromSource( }
parameters, Script); }
// Deal with an occasional segv in the compiler. else
// Rarely, if ever, occurs twice in succession. {
// Line # == 0 and no file name are indications that complete = true;
// this is a native stack trace rather than a normal }
// error log. } while (!complete);
if (results.Errors.Count > 0)
{
if (!retried && string.IsNullOrEmpty(results.Errors[0].FileName) &&
results.Errors[0].Line == 0)
{
// System.Console.WriteLine("retrying failed compilation");
retried = true;
}
else
{
complete = true;
}
}
else
{
complete = true;
}
} while (!complete);
// break;
// default:
// throw new Exception("Compiler is not able to recongnize " +
// "language type \"" + lang.ToString() + "\"");
// }
// foreach (Type type in results.CompiledAssembly.GetTypes())
// {
// foreach (MethodInfo method in type.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static))
// {
// m_log.DebugFormat("[COMPILER]: {0}.{1}", type.FullName, method.Name);
// }
// }
// //
// WARNINGS AND ERRORS // WARNINGS AND ERRORS

View File

@ -2149,10 +2149,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string fn = Path.GetFileName(assemName); string fn = Path.GetFileName(assemName);
string assem = String.Empty; string assem = String.Empty;
string assemNameText = assemName + ".text";
if (File.Exists(assemName + ".text")) if (File.Exists(assemNameText))
{ {
FileInfo tfi = new FileInfo(assemName + ".text"); FileInfo tfi = new FileInfo(assemNameText);
if (tfi != null) if (tfi != null)
{ {
@ -2160,7 +2161,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
try try
{ {
using (FileStream tfs = File.Open(assemName + ".text", using (FileStream tfs = File.Open(assemNameText,
FileMode.Open, FileAccess.Read)) FileMode.Open, FileAccess.Read))
{ {
tfs.Read(tdata, 0, tdata.Length); tfs.Read(tdata, 0, tdata.Length);

View File

@ -478,17 +478,22 @@ namespace OpenSim.Server.Base
XmlDocument doc = new XmlDocument(); XmlDocument doc = new XmlDocument();
doc.LoadXml(data); try
{
doc.LoadXml(data);
XmlNodeList rootL = doc.GetElementsByTagName("ServerResponse");
XmlNodeList rootL = doc.GetElementsByTagName("ServerResponse"); if (rootL.Count != 1)
return ret;
if (rootL.Count != 1) XmlNode rootNode = rootL[0];
return ret;
XmlNode rootNode = rootL[0];
ret = ParseElement(rootNode);
ret = ParseElement(rootNode);
}
catch (Exception e)
{
m_log.DebugFormat("[serverUtils.ParseXmlResponse]: failed error: {0} \n --- string: {1} - ",e.Message, data);
}
return ret; return ret;
} }

View File

@ -34,7 +34,7 @@ using System.Reflection;
using System.Timers; using System.Timers;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Console; using OpenSim.Framework.Monitoring;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using OpenMetaverse; using OpenMetaverse;
@ -135,7 +135,11 @@ namespace OpenSim.Services.Connectors
for (int i = 0 ; i < 2 ; i++) for (int i = 0 ; i < 2 ; i++)
{ {
Util.FireAndForget(delegate { AssetRequestProcessor();}); m_fetchThreads[i] = WorkManager.StartThread(AssetRequestProcessor,
String.Format("GetTextureWorker{0}", i),
ThreadPriority.Normal,
true,
false);
} }
} }
@ -357,7 +361,8 @@ namespace OpenSim.Services.Connectors
while (true) while (true)
{ {
r = m_requestQueue.Dequeue(2000); r = m_requestQueue.Dequeue(4500);
Watchdog.UpdateThread();
if(r== null) if(r== null)
continue; continue;
string uri = r.uri; string uri = r.uri;

View File

@ -462,50 +462,7 @@ namespace OpenSim.Services.Interfaces
/// </value> /// </value>
public IPEndPoint ExternalEndPoint public IPEndPoint ExternalEndPoint
{ {
get get { return Util.getEndPoint(m_externalHostName, m_internalEndPoint.Port); }
{
IPAddress ia = null;
// If it is already an IP, don't resolve it - just return directly
// we should not need this
if (IPAddress.TryParse(m_externalHostName, out ia))
{
if (ia.Equals(IPAddress.Any) || ia.Equals(IPAddress.IPv6Any))
return null;
return new IPEndPoint(ia, m_internalEndPoint.Port);
}
// Reset for next check
ia = null;
try
{
foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName))
{
if (ia == null)
ia = Adr;
if (Adr.AddressFamily == AddressFamily.InterNetwork)
{
ia = Adr;
break;
}
}
}
catch // (SocketException e)
{
/*throw new Exception(
"Unable to resolve local hostname " + m_externalHostName + " innerException of type '" +
e + "' attached to this exception", e);*/
// Don't throw a fatal exception here, instead, return Null and handle it in the caller.
// Reason is, on systems such as OSgrid it has occured that known hostnames stop
// resolving and thus make surrounding regions crash out with this exception.
return null;
}
if(ia == null)
return null;
return new IPEndPoint(ia, m_internalEndPoint.Port);
}
} }
public string ExternalHostName public string ExternalHostName

View File

@ -256,6 +256,10 @@
;; alternative OpenDynamicsEngine engine. ubODEMeshmerizer meshing above MUST be selected also ;; alternative OpenDynamicsEngine engine. ubODEMeshmerizer meshing above MUST be selected also
; physics = ubODE ; physics = ubODE
; ubODE and OpenDynamicsEngine does allocate a lot of memory on stack. On linux you may need to increase its limit
; script opensim-ode-sh starts opensim setting that limit. You may need to increase it even more on large regions
; edit the line ulimit -s 262144, and change this last value
;# {DefaultScriptEngine} {} {Default script engine} {XEngine} XEngine ;# {DefaultScriptEngine} {} {Default script engine} {XEngine} XEngine
;; Default script engine to use. Currently, we only have XEngine ;; Default script engine to use. Currently, we only have XEngine
; DefaultScriptEngine = "XEngine" ; DefaultScriptEngine = "XEngine"

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
echo "Starting OpenSimulator with ODE. If you get an error saying limit: Operation not permitted. Then you will need to chmod 0600 /etc/limits" echo "Starting OpenSimulator with ODE or ubOde. If you get an error saying limit: Operation not permitted. Then you will need to chmod 0600 /etc/limits"
ulimit -s 262144 ulimit -s 262144
mono OpenSim.exe -physics=OpenDynamicsEngine mono OpenSim.exe