mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
Run slow operations in a separate thread, instead of using FireAndForget (which has a 1-minute timeout)
Resolves http://opensimulator.org/mantis/view.php?id=6945
This commit is contained in:
@@ -356,7 +356,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
m_scene.UserAccountService, m_scene.RegionInfo.ScopeID,
|
||||
options, ReceivedAllAssets);
|
||||
|
||||
Util.FireAndForget(o => ar.Execute());
|
||||
Util.RunThreadNoTimeout(o => ar.Execute(), "AssetsRequest", null);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -193,12 +193,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
// Protect ourselves against the caller subsequently modifying the items list
|
||||
List<InventoryItemBase> items = new List<InventoryItemBase>(invCol.Items);
|
||||
|
||||
Util.FireAndForget(delegate
|
||||
Util.RunThreadNoTimeout(delegate
|
||||
{
|
||||
foreach (InventoryItemBase item in items)
|
||||
if (!string.IsNullOrEmpty(item.CreatorData))
|
||||
UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData);
|
||||
});
|
||||
}, "GetFolderContent", null);
|
||||
}
|
||||
|
||||
return invCol;
|
||||
|
||||
@@ -199,7 +199,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
m_rootScene.AssetService, m_rootScene.UserAccountService,
|
||||
m_rootScene.RegionInfo.ScopeID, options, ReceivedAllAssets);
|
||||
|
||||
Util.FireAndForget(o => ar.Execute());
|
||||
Util.RunThreadNoTimeout(o => ar.Execute(), "AssetsRequest", null);
|
||||
|
||||
// CloseArchive() will be called from ReceivedAllAssets()
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
m_requestState = RequestState.Running;
|
||||
|
||||
m_log.DebugFormat("[ARCHIVER]: AssetsRequest executed looking for {0} possible assets", m_repliesRequired);
|
||||
|
||||
|
||||
// We can stop here if there are no assets to fetch
|
||||
if (m_repliesRequired == 0)
|
||||
{
|
||||
@@ -226,7 +226,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
finally
|
||||
{
|
||||
if (timedOut)
|
||||
Util.FireAndForget(PerformAssetsRequestCallback, true);
|
||||
Util.RunThreadNoTimeout(PerformAssetsRequestCallback, "AssetsRequestCallback", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
|
||||
// We want to stop using the asset cache thread asap
|
||||
// as we now need to do the work of producing the rest of the archive
|
||||
Util.FireAndForget(PerformAssetsRequestCallback, false);
|
||||
Util.RunThreadNoTimeout(PerformAssetsRequestCallback, "AssetsRequestCallback", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user