Wrong Breadcrumb Displayed Under Heavy Load

Feb 3, 2011 at 9:42 AM

Hi, i have the following in my site map:

<?xml version="1.0" encoding="utf-8" ?>
<mvcSiteMap xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-2.0" enableLocalization="true">
    <mvcSiteMapNode title="Home" controller="Home" action="Index" changeFrequency="Always" updatePriority="Normal">
        <mvcSiteMapNode title="Forum" controller="Forum" action="Index">
            <mvcSiteMapNode title="View Forum" controller="Forum" action="ViewForum">
                <mvcSiteMapNode title="View Topic" controller="Forum" action="ViewTopic" />

With the following ViewTopic action method:

public ActionResult ViewTopic(int id) {
    var topic = _topicRepository.GetByID(id);

    // Override the parent node title and url
    SiteMap.CurrentNode.ParentNode.Title = topic.Forum.ForumName;
    SiteMap.CurrentNode.ParentNode.Url = Url.GenerateUrl("ViewForum", new { id = topic.Forum.ForumID });

    return View(topic);

Everything was working fine in my testing phase but when the site went live it started mis-behaving.  The wrong subject line and/or forum name keeps appearing in the breadcrumb.  I'm assuming this is due to the heavy load on the server or possible caching issues as more topics are added.

I'd really appreciate it if you could help fix this or offer some suggestions.


Feb 4, 2011 at 10:30 AM

Is there an option to log the calls to MvcSiteMapNode.set_Title and MvcSiteMapNode.get_Title with AppDomain ID, thread ID's, tick count and values? I feel a threading issue here that will be hard to reproduce unless indeed under that heavy load...

Feb 4, 2011 at 1:21 PM

Yeah it definitely sounds like a threading issue.  I've tried looking at the source but this one goes straight over my head.  I was able to reproduce the problem locally by running the IIS Search Engine Optimizer on a fully populated version.  This then fires loads of requests at the site.  If you open a seperate browser you will see the strange behaviour.

Feb 4, 2011 at 2:45 PM

Will try reproducing using IIS SEO optimizer, good tip :-)

Feb 17, 2011 at 11:52 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Mar 10, 2011 at 10:25 AM

Tested the new fixed version but the problem remains.

Mar 25, 2011 at 10:09 PM

Any success in reproducing / tackling this? The 2.4 sources are now storing this information in the curent HttpContext which should be thread safe.