From c11e047410fdabb5c53ebdb7cec637a177254aeb Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Fri, 15 May 2009 20:20:55 +0000
Subject: * Resolve bug where save oar would never complete if any assets were
missing
---
OpenSim/Framework/AssetBase.cs | 5 +++++
.../World/Archiver/ArchiveWriteRequestExecution.cs | 6 +++---
.../CoreModules/World/Archiver/AssetsArchiver.cs | 4 +++-
.../Region/CoreModules/World/Archiver/AssetsRequest.cs | 18 +++++-------------
OpenSim/Services/AssetService/AssetService.cs | 4 ++++
5 files changed, 20 insertions(+), 17 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs
index 4e43cb7..0551533 100644
--- a/OpenSim/Framework/AssetBase.cs
+++ b/OpenSim/Framework/AssetBase.cs
@@ -150,6 +150,11 @@ namespace OpenSim.Framework
get { return m_metadata; }
set { m_metadata = value; }
}
+
+ public override string ToString()
+ {
+ return FullID.ToString();
+ }
}
public class AssetMetadata
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
index b167ce2..20eb393 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
@@ -85,9 +85,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid);
}
- m_log.InfoFormat(
- "[ARCHIVER]: Received {0} of {1} assets requested",
- assetsFoundUuids.Count, assetsFoundUuids.Count + assetsNotFoundUuids.Count);
+// m_log.InfoFormat(
+// "[ARCHIVER]: Received {0} of {1} assets requested",
+// assetsFoundUuids.Count, assetsFoundUuids.Count + assetsNotFoundUuids.Count);
m_log.InfoFormat("[ARCHIVER]: Creating archive file. This may take some time.");
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs
index 0c01cae..e2b08ae 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs
@@ -144,8 +144,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver
m_assetsWritten++;
+ //m_log.DebugFormat("[ARCHIVER]: Added asset {0}", m_assetsWritten);
+
if (m_assetsWritten % LOG_ASSET_LOAD_NOTIFICATION_INTERVAL == 0)
- m_log.InfoFormat("[ARCHIVER]: Added {0} assets to archive", m_assetsWritten);
+ m_log.InfoFormat("[ARCHIVER]: Added {0} assets to archive", m_assetsWritten);
}
}
}
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
index 6cd52ab..97f9b18 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
@@ -97,15 +97,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
foreach (UUID uuid in m_uuids)
{
- m_assetCache.Get(uuid.ToString(), this, AssetReceived);
- }
- }
-
- protected void AssetReceived(string id, object sender, AssetBase asset)
- {
- if (asset != null)
- {
- AssetRequestCallback(asset.FullID, asset);
+ m_assetCache.Get(uuid.ToString(), this, AssetRequestCallback);
}
}
@@ -114,24 +106,24 @@ namespace OpenSim.Region.CoreModules.World.Archiver
///
///
///
- public void AssetRequestCallback(UUID assetID, AssetBase asset)
+ public void AssetRequestCallback(string id, object sender, AssetBase asset)
{
//m_log.DebugFormat("[ARCHIVER]: Received callback for asset {0}", assetID);
if (asset != null)
{
- m_foundAssetUuids.Add(assetID);
+ m_foundAssetUuids.Add(asset.FullID);
m_assetsArchiver.WriteAsset(asset);
}
else
{
- m_notFoundAssetUuids.Add(assetID);
+ m_notFoundAssetUuids.Add(new UUID(id));
}
if (m_foundAssetUuids.Count + m_notFoundAssetUuids.Count == m_repliesRequired)
{
m_log.DebugFormat(
- "[ARCHIVER]: Successfully received {0} assets and notification of {1} missing assets",
+ "[ARCHIVER]: Successfully added {0} assets ({1} assets missing)",
m_foundAssetUuids.Count, m_notFoundAssetUuids.Count);
// We want to stop using the asset cache thread asap
diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs
index bc6d752..af3a746 100644
--- a/OpenSim/Services/AssetService/AssetService.cs
+++ b/OpenSim/Services/AssetService/AssetService.cs
@@ -98,6 +98,8 @@ namespace OpenSim.Services.AssetService
public bool Get(string id, Object sender, AssetRetrieved handler)
{
+ //m_log.DebugFormat("[AssetService]: Got request for {0}", id);
+
UUID assetID;
if (!UUID.TryParse(id, out assetID))
@@ -105,6 +107,8 @@ namespace OpenSim.Services.AssetService
AssetBase asset = m_Database.FetchAsset(assetID);
+ //m_log.DebugFormat("[AssetService]: Got asset {0}", asset);
+
handler(id, sender, asset);
return true;
--
cgit v1.1