On OAR saving, try fetch assets serially rather than firing all the requests at the asset service at once.

This may (or may not) improve reliability for http://opensimulator.org/mantis/view.php?id=5898
Quick tests show that save time is the same.
0.7.4.1
Justin Clark-Casey (justincc) 2012-03-10 02:03:07 +00:00
parent 3a5928f813
commit 1693799623
2 changed files with 19 additions and 10 deletions

View File

@ -219,12 +219,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver
m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
if (SaveAssets) if (SaveAssets)
new AssetsRequest( {
AssetsRequest ar
= new AssetsRequest(
new AssetsArchiver(archiveWriter), assetUuids, new AssetsArchiver(archiveWriter), assetUuids,
m_scene.AssetService, m_scene.UserAccountService, m_scene.AssetService, m_scene.UserAccountService,
m_scene.RegionInfo.ScopeID, options, awre.ReceivedAllAssets).Execute(); m_scene.RegionInfo.ScopeID, options, awre.ReceivedAllAssets);
Util.FireAndForget(o => ar.Execute());
}
else else
awre.ReceivedAllAssets(new List<UUID>(), new List<UUID>()); {
Util.FireAndForget(o => awre.ReceivedAllAssets(new List<UUID>(), new List<UUID>()));
}
} }
catch (Exception) catch (Exception)
{ {

View File

@ -142,12 +142,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver
return; return;
} }
m_requestCallbackTimer.Enabled = true;
foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids) foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids)
{ {
m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback); // m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback);
AssetBase asset = m_assetService.Get(kvp.Key.ToString());
PreAssetRequestCallback(kvp.Key.ToString(), kvp.Value, asset);
} }
m_requestCallbackTimer.Enabled = true;
} }
protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args)