Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • John 88 posts 112 karma points
    Feb 01, 2012 @ 09:33
    John
    0

    DynamicNode Stack Overflow

    Hi. My Umbraco AppPool is crashing every few hours and I believe I've traced it to a razor script I have, below:

     

    var gallery = Model.AncestorOrSelf("gallery");
                    if (gallery == null) 
                    { 
                        if (Model.articleGalleryChooser != null && Model.articleGalleryChooser.GetType() == typeof(Int32))
                        {
                            gallery = Library.NodeById(Model.articleGalleryChooser);
                        }
                        else
                        {
                            gallery = Model; 
                        }
                    }
                    var galleryImages = gallery.Descendants("galleryImage").OrderBy("createDate desc");
                    var galleryImageCount = galleryImages.Count();
    
                    short maxImageHeight = 409;
                    short maxImageWidth = 554;
    
                    var index = 0;
                    var i = 0;
                    var description = "";
    
                    int.TryParse(Request.QueryString["index"], out index);

     

    After this I proceed to look through the galleryImages collection:

    @foreach (var galleryImage in galleryImages) { }

    I thought that's all pretty straight forward but looking at a stack trace I noticed:

    System.Lazy`1[[System.__Canon, mscorlib]].CreateValue()
    System.Lazy`1[[System.__Canon, mscorlib]].LazyInitValue()
    umbraco.MacroEngines.DynamicBackingItem.get_ChildrenAsList()
    umbraco.MacroEngines.DynamicNode.<Descendants>b__3a(umbraco.MacroEngines.DynamicBackingItem)
    umbraco.MacroEngines.ExtensionMethods.Map[[System.__Canon, mscorlib]](System.Collections.Generic.IEnumerable`1<System.__Canon>, System.Func`2<System.__Canon,Boolean>, System.Func`2<System.__Canon,System.Collections.Generic.IEnumerable`1<System.__Canon>>)
    umbraco.MacroEngines.ExtensionMethods.Map[[System.__Canon, mscorlib]](System.Collections.Generic.IEnumerable`1<System.__Canon>, System.Func`2<System.__Canon,Boolean>, System.Func`2<System.__Canon,System.Collections.Generic.IEnumerable`1<System.__Canon>>)
    And the last call above is repeated over 4,000 times. Can anyone see any reasoning for this!?

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Feb 01, 2012 @ 13:26
    Dan Diplo
    0

    Which version of Umbraco are you using> This sounds very much like this issue I created in Codeplex - http://umbraco.codeplex.com/workitem/30498  This was (supposed) to have been fixed in 4.7.1.1  So I'd suggest upgrading to that.

     

  • John 88 posts 112 karma points
    Feb 01, 2012 @ 23:19
    John
    0

    Yep, hat's running version 4.7

    Thanks Dan, I'll try upgrading and see if that solves it.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies