aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorOren Hurvitz2012-04-29 08:53:33 +0300
committerJustin Clark-Casey (justincc)2012-05-07 19:07:38 +0100
commit65c88b2ff4e2616fa5c1d4c5e75298ed1eb1c0d8 (patch)
treed225a88e021c79253bcf782419c31ee1132b8239
parentFor osGetGridNick(), osGetGridName(), osGetGridLoginURI() and osGetGridCustom... (diff)
downloadopensim-SC_OLD-65c88b2ff4e2616fa5c1d4c5e75298ed1eb1c0d8.zip
opensim-SC_OLD-65c88b2ff4e2616fa5c1d4c5e75298ed1eb1c0d8.tar.gz
opensim-SC_OLD-65c88b2ff4e2616fa5c1d4c5e75298ed1eb1c0d8.tar.bz2
opensim-SC_OLD-65c88b2ff4e2616fa5c1d4c5e75298ed1eb1c0d8.tar.xz
Better error handling if Load OAR or Save OAR fail
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs20
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs7
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs11
3 files changed, 32 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index a6dbaba..e360f93 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -200,8 +200,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
200 } 200 }
201 catch (Exception e) 201 catch (Exception e)
202 { 202 {
203 m_log.ErrorFormat( 203 m_log.Error(
204 "[ARCHIVER]: Aborting load with error in archive file {0}. {1}", filePath, e); 204 String.Format("[ARCHIVER]: Aborting load with error in archive file {0} ", filePath), e);
205 m_errorMessage += e.ToString(); 205 m_errorMessage += e.ToString();
206 m_scene.EventManager.TriggerOarFileLoaded(m_requestId, m_errorMessage); 206 m_scene.EventManager.TriggerOarFileLoaded(m_requestId, m_errorMessage);
207 return; 207 return;
@@ -219,6 +219,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
219 { 219 {
220 m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores); 220 m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores);
221 m_errorMessage += String.Format("Failed to load {0} assets", failedAssetRestores); 221 m_errorMessage += String.Format("Failed to load {0} assets", failedAssetRestores);
222 // Continue, because we allow the OAR to be loaded even if some assets fail
222 } 223 }
223 } 224 }
224 225
@@ -228,8 +229,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver
228 m_scene.DeleteAllSceneObjects(); 229 m_scene.DeleteAllSceneObjects();
229 } 230 }
230 231
231 LoadParcels(serialisedParcels); 232 try
232 LoadObjects(serialisedSceneObjects); 233 {
234 LoadParcels(serialisedParcels);
235 LoadObjects(serialisedSceneObjects);
236 }
237 catch (Exception e)
238 {
239 m_log.Error("[ARCHIVER]: Error loading parcels or objects ", e);
240 m_errorMessage += e.ToString();
241 m_scene.EventManager.TriggerOarFileLoaded(m_requestId, m_errorMessage);
242 return;
243 }
244
233 245
234 m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); 246 m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive");
235 247
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
index c179a34..2b40a9e 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
@@ -87,6 +87,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
87 { 87 {
88 Save(assetsFoundUuids, assetsNotFoundUuids); 88 Save(assetsFoundUuids, assetsNotFoundUuids);
89 } 89 }
90 catch (Exception e)
91 {
92 m_scene.EventManager.TriggerOarFileSaved(m_requestId, e.ToString());
93 throw;
94 }
90 finally 95 finally
91 { 96 {
92 m_archiveWriter.Close(); 97 m_archiveWriter.Close();
@@ -150,4 +155,4 @@ namespace OpenSim.Region.CoreModules.World.Archiver
150 } 155 }
151 } 156 }
152 } 157 }
153} \ No newline at end of file 158}
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
index eabe46e..384d81b 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -124,6 +124,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
124 if (options.ContainsKey("noassets") && (bool)options["noassets"]) 124 if (options.ContainsKey("noassets") && (bool)options["noassets"])
125 SaveAssets = false; 125 SaveAssets = false;
126 126
127 // Whether someone else (i.e., ReceivedAllAssets()) is responsible for calling TriggerOarFileSaved() when we're done
128 bool eventHandled = false;
129
127 try 130 try
128 { 131 {
129 Dictionary<UUID, AssetType> assetUuids = new Dictionary<UUID, AssetType>(); 132 Dictionary<UUID, AssetType> assetUuids = new Dictionary<UUID, AssetType>();
@@ -230,15 +233,21 @@ namespace OpenSim.Region.CoreModules.World.Archiver
230 m_scene.RegionInfo.ScopeID, options, awre.ReceivedAllAssets); 233 m_scene.RegionInfo.ScopeID, options, awre.ReceivedAllAssets);
231 234
232 Util.FireAndForget(o => ar.Execute()); 235 Util.FireAndForget(o => ar.Execute());
236 eventHandled = true;
233 } 237 }
234 else 238 else
235 { 239 {
236 awre.ReceivedAllAssets(new List<UUID>(), new List<UUID>()); 240 awre.ReceivedAllAssets(new List<UUID>(), new List<UUID>());
241 eventHandled = true;
237 } 242 }
238 } 243 }
239 catch (Exception) 244 catch (Exception e)
240 { 245 {
241 m_saveStream.Close(); 246 m_saveStream.Close();
247
248 if (!eventHandled)
249 m_scene.EventManager.TriggerOarFileSaved(m_requestId, e.ToString());
250
242 throw; 251 throw;
243 } 252 }
244 } 253 }