Copied to clipboard

Flag this post as spam?

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


  • Karl Campeau 12 posts 34 karma points
    Jun 18, 2015 @ 19:59
    Karl Campeau
    0

    Response.Redirect - Error loading MacroEngine script - Under Load

    I'm currently using Umbraco v6.1.6 and I'm experiencing random "Error loading MacroEngine script..." errors on pages that are called from Response.Redirect(URL). The errors become more prominent as load increases (see stats from below).

    # of Requests - Rate - # of Errors
    75 - 7/sec - 22 errors
    85 - 7/sec - 16 errors
    139 - 6/sec - 1 errors
    101 - 6/sec - 0 errors
    89 - 5/sec - 0 errors
    77 - 2/sec - 0 errors

    I had this same issue with Umbraco v4 and successfully addressed it by implementing the following logic according to what I found in http://adaodeveloper.blogspot.com/2013/02/radom-intermittent-error-loading-razor.html:
    Response.Redirect(URL, false);
    Context.ApplicationInstance.CompleteRequest();

    I tried applying the same logic to our v6 logic but it did not help. I also tried the following variation which did not help:
    Response.Redirect(URL, false);
    Response.End();

    Here is an example of the html that is displayed to the user:

    <!-- FOOTER -->
    Error loading MacroEngine script (file: /general/Footer.cshtml)
    

    Here is what my master file looks like:

    <!-- FOOTER -->
     <umbraco:Macro ID="Macro6" Alias="Footer" runat="server" />
    

    Here is what the exception that is being logged looks like (please note that the two cshtml files do not match):
    Error loading MacroEngine script (file: /general/Footer.cshtml, Type: ''. Exception: System.Threading.ThreadAbortException: Thread was being aborted. at System.Threading.Thread.AbortInternal() at System.Threading.Thread.Abort(Object stateInfo) at System.Web.HttpResponse.AbortCurrentThread() at System.Web.HttpResponse.End() at System.Web.HttpResponseWrapper.End() at ASP.PagemacroScriptsgeneralWelcome_cshtml.Execute() in [PATH]\ Welcome.cshtml :line 24 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) at System.Web.WebPages.WebPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage) at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)

    It looks like all of the macros in my master file randomly throw this exception.

    I realize that Response.Redirect(URL) throws the same exception. However, it seems that the "Error loading..." error is only displayed to the user when the cshtml files do not match.

    Has anyone experienced this and how did you address it?

Please Sign in or register to post replies

Write your reply to:

Draft