Emptying Cache Seems to Tear Down Tenant

Apr 29, 2014 at 4:17 PM
Great module by the way. One observation I have is that (sometimes) when I empty the cache on a tenant site, it seems to cause the shell to shut down and start back up (takes a minute or so and causes negative impacts on other tenants). I don't know if this is expected or not. Other times emptying the cache only takes 2-3 seconds. Just wondering if you have observed this or if there is a place I should investigate further to see what might be going on.
Apr 29, 2014 at 6:31 PM
I'm also experiencing it sometimes locally but never on our live sites. I filed a bug report with Orchard before because what the module does is just using the standard file handling services: https://orchard.codeplex.com/workitem/19284 But I couldn't provide a reliable repro.
Apr 29, 2014 at 6:38 PM
Mine has occurred on the live site and not localhost, same here though, no consistent repo. I actually have the issue of the media processing that is linked to in your work item also. Of course, can't reproduce that either... I will keep my eyes out for a consistent repo. Thanks for the prompt reply!
Apr 29, 2014 at 7:20 PM
No problem. I just got the idea that maybe, maybe this has something to do with the Thread.Sleep() calls in CacheFileService (which are workarounds themselves too...). Would you mind trying to remove them and see whether you can still occasionally reproduce the issue?
May 4, 2014 at 10:39 PM
I will have to look into it. The Combinator is indirectly causing more trouble as now it seems to be consistently tearing down the tenants with an added problem that the tenants are not always coming back up. So clearing the combinatory in TenantA can actually cause unrelated TenantB to not come back up. I will see if it is doing the same thing on localhost and try to isolate the issue. Of course, I will start by looking at the area you suggested.
May 4, 2014 at 10:47 PM
OK, thank you.
Jul 7, 2014 at 7:57 PM
Would you mind trying with the latest source? Cache clearing is much simpler (and faster) now.
Jul 7, 2014 at 9:04 PM
Definitely, thanks for letting me know.
Jul 7, 2014 at 9:31 PM
Wow, locally it is extremely fast. Will let you know what happens on live site (should be in a week or so).
Jul 7, 2014 at 9:41 PM
Jul 9, 2014 at 7:31 PM
Hi Piedone,

Been having one consistent error creeping in since I upgraded the Combinator. I am only utilizing on localhost but hoping you can give some insight into this error. The error is occurring in Piecone.Combinator.Models.CombinatorResource --> RelativeVirtualPath property. Here is where I am referring
        public string RelativeVirtualPath
                if (String.IsNullOrEmpty(NormalizedFullPath)) return "~/";
                return VirtualPathUtility.ToAppRelative(NormalizedFullPath, ApplicationPath);
It seems the combined file is being passed back through since I see this (when monitoring NormalizedFullPath):


Then the next iteration it is this:


And of course it breaks on this one with an error similar to:

2014-07-09 14:01:01,740 [367] Piedone.Combinator.CombinedResourceManager - EndlessMountainSolutions - Error when combining Style files
System.ArgumentException: The relative virtual path 'http:/endlessmountainsolutions.localhost/Media/EndlessMountainSolutions/_PiedoneModules/Combinator/Styles/1297743854-min-noembed-nosprites-1.css' is not allowed here.
at System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options)
at System.Web.VirtualPathUtility.ToAppRelative(String virtualPath, String applicationPath)
at Piedone.Combinator.Models.CombinatorResource.get_RelativeVirtualPath()
at Piedone.Combinator.Models.CombinatorResource.get_RelativeUrl()
at Piedone.Combinator.Services.CombinatorResourceManager.SerializeResourceSettings(CombinatorResource resource)
at Piedone.Combinator.Services.CacheFileService.Save(String fingerprint, CombinatorResource resource, Uri resourceBaseUri, Boolean useResourceShare)
at Piedone.Combinator.Services.CombinatorService.<>c__DisplayClassd.<Combine>b__b(CombinatorResource combinedResource, List1 containedResources)
at Piedone.Combinator.Services.CombinatorService.Combine(IList
1 resources, String fingerprint, ResourceType resourceType, ICombinatorSettings settings)
at Piedone.Combinator.Services.CombinatorService.CombineStylesheets(IList`1 resources, ICombinatorSettings settings)
at Piedone.Combinator.CombinedResourceManager.BuildRequiredResources(String stringResourceType)

It seems that the Combinator is trying to (for some reason) combine a prior combined resource. This is far as my debugging has proceeded. Look forward to your thoughts and glad to share screens to review if you like.
Jul 13, 2014 at 12:10 AM
Thanks for testing! This was a new bug, fixed in the latest source.
Jul 13, 2014 at 11:43 PM
OK, finally found the real issue and it's bigger than I thought: https://orchard.codeplex.com/workitem/20802 The solution I can only suggest you currently is not to use the Media folder under the application folder (but place it somewhere else, or probably use some form of cloud storage).