diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 87 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | 18 |
2 files changed, 74 insertions, 31 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 730643d..96e8f35 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | |||
@@ -363,12 +363,13 @@ namespace OpenSim.Region.CoreModules.Asset | |||
363 | /// Try to get an asset from the file cache. | 363 | /// Try to get an asset from the file cache. |
364 | /// </summary> | 364 | /// </summary> |
365 | /// <param name="id"></param> | 365 | /// <param name="id"></param> |
366 | /// <returns></returns> | 366 | /// <returns>An asset retrieved from the file cache. null if there was a problem retrieving an asset.</returns> |
367 | private AssetBase GetFromFileCache(string id) | 367 | private AssetBase GetFromFileCache(string id) |
368 | { | 368 | { |
369 | AssetBase asset = null; | 369 | AssetBase asset = null; |
370 | 370 | ||
371 | string filename = GetFileName(id); | 371 | string filename = GetFileName(id); |
372 | |||
372 | if (File.Exists(filename)) | 373 | if (File.Exists(filename)) |
373 | { | 374 | { |
374 | FileStream stream = null; | 375 | FileStream stream = null; |
@@ -383,7 +384,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
383 | } | 384 | } |
384 | catch (System.Runtime.Serialization.SerializationException e) | 385 | catch (System.Runtime.Serialization.SerializationException e) |
385 | { | 386 | { |
386 | m_log.ErrorFormat( | 387 | m_log.WarnFormat( |
387 | "[FLOTSAM ASSET CACHE]: Failed to get file {0} for asset {1}. Exception {2} {3}", | 388 | "[FLOTSAM ASSET CACHE]: Failed to get file {0} for asset {1}. Exception {2} {3}", |
388 | filename, id, e.Message, e.StackTrace); | 389 | filename, id, e.Message, e.StackTrace); |
389 | 390 | ||
@@ -395,7 +396,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
395 | } | 396 | } |
396 | catch (Exception e) | 397 | catch (Exception e) |
397 | { | 398 | { |
398 | m_log.ErrorFormat( | 399 | m_log.WarnFormat( |
399 | "[FLOTSAM ASSET CACHE]: Failed to get file {0} for asset {1}. Exception {2} {3}", | 400 | "[FLOTSAM ASSET CACHE]: Failed to get file {0} for asset {1}. Exception {2} {3}", |
400 | filename, id, e.Message, e.StackTrace); | 401 | filename, id, e.Message, e.StackTrace); |
401 | } | 402 | } |
@@ -552,7 +553,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
552 | } | 553 | } |
553 | catch (Exception e) | 554 | catch (Exception e) |
554 | { | 555 | { |
555 | m_log.ErrorFormat( | 556 | m_log.WarnFormat( |
556 | "[FLOTSAM ASSET CACHE]: Failed to expire cached file {0}. Exception {1} {2}", | 557 | "[FLOTSAM ASSET CACHE]: Failed to expire cached file {0}. Exception {1} {2}", |
557 | id, e.Message, e.StackTrace); | 558 | id, e.Message, e.StackTrace); |
558 | } | 559 | } |
@@ -603,29 +604,39 @@ namespace OpenSim.Region.CoreModules.Asset | |||
603 | /// <param name="purgeLine"></param> | 604 | /// <param name="purgeLine"></param> |
604 | private void CleanExpiredFiles(string dir, DateTime purgeLine) | 605 | private void CleanExpiredFiles(string dir, DateTime purgeLine) |
605 | { | 606 | { |
606 | foreach (string file in Directory.GetFiles(dir)) | 607 | try |
607 | { | 608 | { |
608 | if (File.GetLastAccessTime(file) < purgeLine) | 609 | foreach (string file in Directory.GetFiles(dir)) |
609 | { | 610 | { |
610 | File.Delete(file); | 611 | if (File.GetLastAccessTime(file) < purgeLine) |
612 | { | ||
613 | File.Delete(file); | ||
614 | } | ||
611 | } | 615 | } |
612 | } | ||
613 | 616 | ||
614 | // Recurse into lower tiers | 617 | // Recurse into lower tiers |
615 | foreach (string subdir in Directory.GetDirectories(dir)) | 618 | foreach (string subdir in Directory.GetDirectories(dir)) |
616 | { | 619 | { |
617 | CleanExpiredFiles(subdir, purgeLine); | 620 | CleanExpiredFiles(subdir, purgeLine); |
618 | } | 621 | } |
619 | 622 | ||
620 | // Check if a tier directory is empty, if so, delete it | 623 | // Check if a tier directory is empty, if so, delete it |
621 | int dirSize = Directory.GetFiles(dir).Length + Directory.GetDirectories(dir).Length; | 624 | int dirSize = Directory.GetFiles(dir).Length + Directory.GetDirectories(dir).Length; |
622 | if (dirSize == 0) | 625 | if (dirSize == 0) |
623 | { | 626 | { |
624 | Directory.Delete(dir); | 627 | Directory.Delete(dir); |
628 | } | ||
629 | else if (dirSize >= m_CacheWarnAt) | ||
630 | { | ||
631 | m_log.WarnFormat( | ||
632 | "[FLOTSAM ASSET CACHE]: Cache folder exceeded CacheWarnAt limit {0} {1}. Suggest increasing tiers, tier length, or reducing cache expiration", | ||
633 | dir, dirSize); | ||
634 | } | ||
625 | } | 635 | } |
626 | else if (dirSize >= m_CacheWarnAt) | 636 | catch (Exception e) |
627 | { | 637 | { |
628 | m_log.WarnFormat("[FLOTSAM ASSET CACHE]: Cache folder exceeded CacheWarnAt limit {0} {1}. Suggest increasing tiers, tier length, or reducing cache expiration", dir, dirSize); | 638 | m_log.Warn( |
639 | string.Format("[FLOTSAM ASSET CACHE]: Could not complete clean of expired files in {0}, exception ", dir), e); | ||
629 | } | 640 | } |
630 | } | 641 | } |
631 | 642 | ||
@@ -684,7 +695,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
684 | } | 695 | } |
685 | catch (IOException e) | 696 | catch (IOException e) |
686 | { | 697 | { |
687 | m_log.ErrorFormat( | 698 | m_log.WarnFormat( |
688 | "[FLOTSAM ASSET CACHE]: Failed to write asset {0} to temporary location {1} (final {2}) on cache in {3}. Exception {4} {5}.", | 699 | "[FLOTSAM ASSET CACHE]: Failed to write asset {0} to temporary location {1} (final {2}) on cache in {3}. Exception {4} {5}.", |
689 | asset.ID, tempname, filename, directory, e.Message, e.StackTrace); | 700 | asset.ID, tempname, filename, directory, e.Message, e.StackTrace); |
690 | 701 | ||
@@ -763,17 +774,31 @@ namespace OpenSim.Region.CoreModules.Asset | |||
763 | /// <summary> | 774 | /// <summary> |
764 | /// This notes the last time the Region had a deep asset scan performed on it. | 775 | /// This notes the last time the Region had a deep asset scan performed on it. |
765 | /// </summary> | 776 | /// </summary> |
766 | /// <param name="RegionID"></param> | 777 | /// <param name="regionID"></param> |
767 | private void StampRegionStatusFile(UUID RegionID) | 778 | private void StampRegionStatusFile(UUID regionID) |
768 | { | 779 | { |
769 | string RegionCacheStatusFile = Path.Combine(m_CacheDirectory, "RegionStatus_" + RegionID.ToString() + ".fac"); | 780 | string RegionCacheStatusFile = Path.Combine(m_CacheDirectory, "RegionStatus_" + regionID.ToString() + ".fac"); |
770 | if (File.Exists(RegionCacheStatusFile)) | 781 | |
782 | try | ||
771 | { | 783 | { |
772 | File.SetLastWriteTime(RegionCacheStatusFile, DateTime.Now); | 784 | if (File.Exists(RegionCacheStatusFile)) |
785 | { | ||
786 | File.SetLastWriteTime(RegionCacheStatusFile, DateTime.Now); | ||
787 | } | ||
788 | else | ||
789 | { | ||
790 | File.WriteAllText( | ||
791 | RegionCacheStatusFile, | ||
792 | "Please do not delete this file unless you are manually clearing your Flotsam Asset Cache."); | ||
793 | } | ||
773 | } | 794 | } |
774 | else | 795 | catch (Exception e) |
775 | { | 796 | { |
776 | File.WriteAllText(RegionCacheStatusFile, "Please do not delete this file unless you are manually clearing your Flotsam Asset Cache."); | 797 | m_log.Warn( |
798 | string.Format( | ||
799 | "[FLOTSAM ASSET CACHE]: Could not stamp region status file for region {0}. Exception ", | ||
800 | regionID), | ||
801 | e); | ||
777 | } | 802 | } |
778 | } | 803 | } |
779 | 804 | ||
@@ -842,7 +867,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
842 | } | 867 | } |
843 | catch (Exception e) | 868 | catch (Exception e) |
844 | { | 869 | { |
845 | m_log.ErrorFormat( | 870 | m_log.WarnFormat( |
846 | "[FLOTSAM ASSET CACHE]: Couldn't clear asset cache directory {0} from {1}. Exception {2} {3}", | 871 | "[FLOTSAM ASSET CACHE]: Couldn't clear asset cache directory {0} from {1}. Exception {2} {3}", |
847 | dir, m_CacheDirectory, e.Message, e.StackTrace); | 872 | dir, m_CacheDirectory, e.Message, e.StackTrace); |
848 | } | 873 | } |
@@ -856,7 +881,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
856 | } | 881 | } |
857 | catch (Exception e) | 882 | catch (Exception e) |
858 | { | 883 | { |
859 | m_log.ErrorFormat( | 884 | m_log.WarnFormat( |
860 | "[FLOTSAM ASSET CACHE]: Couldn't clear asset cache file {0} from {1}. Exception {1} {2}", | 885 | "[FLOTSAM ASSET CACHE]: Couldn't clear asset cache file {0} from {1}. Exception {1} {2}", |
861 | file, m_CacheDirectory, e.Message, e.StackTrace); | 886 | file, m_CacheDirectory, e.Message, e.StackTrace); |
862 | } | 887 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index dc2b0e0..6c3ac0c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -487,6 +487,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
487 | { | 487 | { |
488 | // m_log.DebugFormat( | 488 | // m_log.DebugFormat( |
489 | // "[INVENTORY ARCHIVER]: Loaded coalescence {0} has {1} objects", assetId, coa.Count); | 489 | // "[INVENTORY ARCHIVER]: Loaded coalescence {0} has {1} objects", assetId, coa.Count); |
490 | |||
491 | if (coa.Objects.Count == 0) | ||
492 | { | ||
493 | m_log.WarnFormat( | ||
494 | "[INVENTORY ARCHIVE READ REQUEST]: Aborting load of coalesced object from asset {0} as it has zero loaded components", | ||
495 | assetId); | ||
496 | return false; | ||
497 | } | ||
490 | 498 | ||
491 | sceneObjects.AddRange(coa.Objects); | 499 | sceneObjects.AddRange(coa.Objects); |
492 | } | 500 | } |
@@ -495,7 +503,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
495 | SceneObjectGroup deserializedObject = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); | 503 | SceneObjectGroup deserializedObject = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); |
496 | 504 | ||
497 | if (deserializedObject != null) | 505 | if (deserializedObject != null) |
506 | { | ||
498 | sceneObjects.Add(deserializedObject); | 507 | sceneObjects.Add(deserializedObject); |
508 | } | ||
509 | else | ||
510 | { | ||
511 | m_log.WarnFormat( | ||
512 | "[INVENTORY ARCHIVE READ REQUEST]: Aborting load of object from asset {0} as deserialization failed", | ||
513 | assetId); | ||
514 | |||
515 | return false; | ||
516 | } | ||
499 | } | 517 | } |
500 | 518 | ||
501 | foreach (SceneObjectGroup sog in sceneObjects) | 519 | foreach (SceneObjectGroup sog in sceneObjects) |