diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver')
4 files changed, 56 insertions, 39 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 01f1c63..fcfdf7c 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -622,13 +622,18 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
622 | /// <returns></returns> | 622 | /// <returns></returns> |
623 | private bool ResolveUserUuid(Scene scene, UUID uuid) | 623 | private bool ResolveUserUuid(Scene scene, UUID uuid) |
624 | { | 624 | { |
625 | if (!m_validUserUuids.ContainsKey(uuid)) | 625 | lock (m_validUserUuids) |
626 | { | 626 | { |
627 | UserAccount account = scene.UserAccountService.GetUserAccount(scene.RegionInfo.ScopeID, uuid); | 627 | if (!m_validUserUuids.ContainsKey(uuid)) |
628 | m_validUserUuids.Add(uuid, account != null); | 628 | { |
629 | } | 629 | // Note: we call GetUserAccount() inside the lock because this UserID is likely |
630 | // to occur many times, and we only want to query the users service once. | ||
631 | UserAccount account = scene.UserAccountService.GetUserAccount(scene.RegionInfo.ScopeID, uuid); | ||
632 | m_validUserUuids.Add(uuid, account != null); | ||
633 | } | ||
630 | 634 | ||
631 | return m_validUserUuids[uuid]; | 635 | return m_validUserUuids[uuid]; |
636 | } | ||
632 | } | 637 | } |
633 | 638 | ||
634 | /// <summary> | 639 | /// <summary> |
@@ -641,19 +646,26 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
641 | if (uuid == UUID.Zero) | 646 | if (uuid == UUID.Zero) |
642 | return true; // this means the object has no group | 647 | return true; // this means the object has no group |
643 | 648 | ||
644 | if (!m_validGroupUuids.ContainsKey(uuid)) | 649 | lock (m_validGroupUuids) |
645 | { | 650 | { |
646 | bool exists; | 651 | if (!m_validGroupUuids.ContainsKey(uuid)) |
647 | 652 | { | |
648 | if (m_groupsModule == null) | 653 | bool exists; |
649 | exists = false; | 654 | if (m_groupsModule == null) |
650 | else | 655 | { |
651 | exists = (m_groupsModule.GetGroupRecord(uuid) != null); | 656 | exists = false; |
657 | } | ||
658 | else | ||
659 | { | ||
660 | // Note: we call GetGroupRecord() inside the lock because this GroupID is likely | ||
661 | // to occur many times, and we only want to query the groups service once. | ||
662 | exists = (m_groupsModule.GetGroupRecord(uuid) != null); | ||
663 | } | ||
664 | m_validGroupUuids.Add(uuid, exists); | ||
665 | } | ||
652 | 666 | ||
653 | m_validGroupUuids.Add(uuid, exists); | 667 | return m_validGroupUuids[uuid]; |
654 | } | 668 | } |
655 | |||
656 | return m_validGroupUuids[uuid]; | ||
657 | } | 669 | } |
658 | 670 | ||
659 | /// Load an asset | 671 | /// Load an asset |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs index 7bdd65c..367693d 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs | |||
@@ -587,19 +587,29 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
587 | } | 587 | } |
588 | } | 588 | } |
589 | 589 | ||
590 | protected void ReceivedAllAssets( | 590 | protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids, bool timedOut) |
591 | ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids) | ||
592 | { | 591 | { |
593 | foreach (UUID uuid in assetsNotFoundUuids) | 592 | string errorMessage; |
593 | |||
594 | if (timedOut) | ||
594 | { | 595 | { |
595 | m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); | 596 | errorMessage = "Loading assets timed out"; |
596 | } | 597 | } |
598 | else | ||
599 | { | ||
600 | foreach (UUID uuid in assetsNotFoundUuids) | ||
601 | { | ||
602 | m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); | ||
603 | } | ||
597 | 604 | ||
598 | // m_log.InfoFormat( | 605 | // m_log.InfoFormat( |
599 | // "[ARCHIVER]: Received {0} of {1} assets requested", | 606 | // "[ARCHIVER]: Received {0} of {1} assets requested", |
600 | // assetsFoundUuids.Count, assetsFoundUuids.Count + assetsNotFoundUuids.Count); | 607 | // assetsFoundUuids.Count, assetsFoundUuids.Count + assetsNotFoundUuids.Count); |
601 | 608 | ||
602 | CloseArchive(String.Empty); | 609 | errorMessage = String.Empty; |
610 | } | ||
611 | |||
612 | CloseArchive(errorMessage); | ||
603 | } | 613 | } |
604 | 614 | ||
605 | /// <summary> | 615 | /// <summary> |
@@ -626,4 +636,4 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
626 | m_rootScene.EventManager.TriggerOarFileSaved(m_requestId, errorMessage); | 636 | m_rootScene.EventManager.TriggerOarFileSaved(m_requestId, errorMessage); |
627 | } | 637 | } |
628 | } | 638 | } |
629 | } \ No newline at end of file | 639 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs index 95d109c..c1ff94d 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs | |||
@@ -150,12 +150,5 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
150 | m_log.InfoFormat("[ARCHIVER]: Added {0} assets to archive", m_assetsWritten); | 150 | m_log.InfoFormat("[ARCHIVER]: Added {0} assets to archive", m_assetsWritten); |
151 | } | 151 | } |
152 | 152 | ||
153 | /// <summary> | ||
154 | /// Only call this if you need to force a close on the underlying writer. | ||
155 | /// </summary> | ||
156 | public void ForceClose() | ||
157 | { | ||
158 | m_archiveWriter.Close(); | ||
159 | } | ||
160 | } | 153 | } |
161 | } | 154 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index e2f8833..715bf51 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
50 | /// Method called when all the necessary assets for an archive request have been received. | 50 | /// Method called when all the necessary assets for an archive request have been received. |
51 | /// </summary> | 51 | /// </summary> |
52 | public delegate void AssetsRequestCallback( | 52 | public delegate void AssetsRequestCallback( |
53 | ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids); | 53 | ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids, bool timedOut); |
54 | 54 | ||
55 | enum RequestState | 55 | enum RequestState |
56 | { | 56 | { |
@@ -148,7 +148,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
148 | if (m_repliesRequired == 0) | 148 | if (m_repliesRequired == 0) |
149 | { | 149 | { |
150 | m_requestState = RequestState.Completed; | 150 | m_requestState = RequestState.Completed; |
151 | PerformAssetsRequestCallback(null); | 151 | PerformAssetsRequestCallback(false); |
152 | return; | 152 | return; |
153 | } | 153 | } |
154 | 154 | ||
@@ -164,7 +164,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
164 | 164 | ||
165 | protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) | 165 | protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) |
166 | { | 166 | { |
167 | bool close = true; | 167 | bool timedOut = true; |
168 | 168 | ||
169 | try | 169 | try |
170 | { | 170 | { |
@@ -174,7 +174,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
174 | // the final request came in (assuming that such a thing is possible) | 174 | // the final request came in (assuming that such a thing is possible) |
175 | if (m_requestState == RequestState.Completed) | 175 | if (m_requestState == RequestState.Completed) |
176 | { | 176 | { |
177 | close = false; | 177 | timedOut = false; |
178 | return; | 178 | return; |
179 | } | 179 | } |
180 | 180 | ||
@@ -223,8 +223,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
223 | } | 223 | } |
224 | finally | 224 | finally |
225 | { | 225 | { |
226 | if (close) | 226 | if (timedOut) |
227 | m_assetsArchiver.ForceClose(); | 227 | Util.FireAndForget(PerformAssetsRequestCallback, true); |
228 | } | 228 | } |
229 | } | 229 | } |
230 | 230 | ||
@@ -290,7 +290,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
290 | 290 | ||
291 | // We want to stop using the asset cache thread asap | 291 | // We want to stop using the asset cache thread asap |
292 | // as we now need to do the work of producing the rest of the archive | 292 | // as we now need to do the work of producing the rest of the archive |
293 | Util.FireAndForget(PerformAssetsRequestCallback); | 293 | Util.FireAndForget(PerformAssetsRequestCallback, false); |
294 | } | 294 | } |
295 | else | 295 | else |
296 | { | 296 | { |
@@ -311,9 +311,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
311 | { | 311 | { |
312 | Culture.SetCurrentCulture(); | 312 | Culture.SetCurrentCulture(); |
313 | 313 | ||
314 | Boolean timedOut = (Boolean)o; | ||
315 | |||
314 | try | 316 | try |
315 | { | 317 | { |
316 | m_assetsRequestCallback(m_foundAssetUuids, m_notFoundAssetUuids); | 318 | m_assetsRequestCallback(m_foundAssetUuids, m_notFoundAssetUuids, timedOut); |
317 | } | 319 | } |
318 | catch (Exception e) | 320 | catch (Exception e) |
319 | { | 321 | { |