give BlockingCollection more chances

httptests
UbitUmarov 2018-01-22 02:42:50 +00:00
parent d4a5454f3c
commit 437369778d
3 changed files with 12 additions and 15 deletions

View File

@ -232,6 +232,7 @@ namespace OpenSim.Region.ClientStack.Linden
m_workerThreads = null; m_workerThreads = null;
} }
} }
// m_queue.Dispose();
} }
public string Name { get { return "WebFetchInvDescModule"; } } public string Name { get { return "WebFetchInvDescModule"; } }

View File

@ -435,7 +435,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
WorkManager.RunInThread(o => WorkManager.RunInThread(o =>
{ {
Thread.Sleep(15000); Thread.Sleep(15000);
m_log.Info("[ARCHIVER]: Starting scripts in scene objects"); m_log.Info("[ARCHIVER]: Starting scripts in scene objects...");
foreach (DearchiveContext sceneContext in sceneContexts.Values) foreach (DearchiveContext sceneContext in sceneContexts.Values)
{ {
@ -447,6 +447,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
sceneContext.SceneObjects.Clear(); sceneContext.SceneObjects.Clear();
} }
m_log.Info("[ARCHIVER]: Start scripts done");
}, null, string.Format("ReadArchiveStartScripts (request {0})", m_requestId)); }, null, string.Format("ReadArchiveStartScripts (request {0})", m_requestId));
} }
@ -945,10 +946,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
if (m_assetService.GetMetadata(uuid) != null) if (m_assetService.GetMetadata(uuid) != null)
{ {
sbyte asype = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; sbyte asype = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
if(asype == -2)
{
}
// m_log.DebugFormat("[ARCHIVER]: found existing asset {0}",uuid); // m_log.DebugFormat("[ARCHIVER]: found existing asset {0}",uuid);
return true; return true;
@ -958,10 +955,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
{ {
sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
if(assetType == -2)
{
}
if (assetType == (sbyte)AssetType.Unknown) if (assetType == (sbyte)AssetType.Unknown)
{ {
m_log.WarnFormat("[ARCHIVER]: Importing {0} byte asset {1} with unknown type", data.Length, uuid); m_log.WarnFormat("[ARCHIVER]: Importing {0} byte asset {1} with unknown type", data.Length, uuid);

View File

@ -29,6 +29,7 @@ using log4net;
using System; using System;
using System.Threading; using System.Threading;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Concurrent;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.Timers; using System.Timers;
@ -352,8 +353,7 @@ namespace OpenSim.Services.Connectors
public string id; public string id;
} }
private OpenSim.Framework.BlockingQueue<QueuedAssetRequest> m_requestQueue = private BlockingCollection<QueuedAssetRequest> m_requestQueue = new BlockingCollection<QueuedAssetRequest>();
new OpenSim.Framework.BlockingQueue<QueuedAssetRequest>();
private void AssetRequestProcessor() private void AssetRequestProcessor()
{ {
@ -361,10 +361,13 @@ namespace OpenSim.Services.Connectors
while (true) while (true)
{ {
r = m_requestQueue.Dequeue(4500); if(!m_requestQueue.TryTake(out r, 4500) || r == null)
Watchdog.UpdateThread(); {
if(r== null) Watchdog.UpdateThread();
continue; continue;
}
Watchdog.UpdateThread();
string uri = r.uri; string uri = r.uri;
string id = r.id; string id = r.id;
@ -432,7 +435,7 @@ namespace OpenSim.Services.Connectors
QueuedAssetRequest request = new QueuedAssetRequest(); QueuedAssetRequest request = new QueuedAssetRequest();
request.id = id; request.id = id;
request.uri = uri; request.uri = uri;
m_requestQueue.Enqueue(request); m_requestQueue.Add(request);
} }
} }
else else