0

We normally have a 3rd party logger, NLog that captures application errors, but it wasn't capturing these ones. The only place it was possible to view error details was in the Windows Event Viewer, these would show up as warnings.The error seems to be a result of a postback triggered from an asp:Timer control

The error message as it is logged in event viewer: Error message

The timer in our web form page:

      <asp:UpdatePanel ID="uPnlMsgMngmt" runat="server">  
        <ContentTemplate> 
            <asp:Timer ID="tmMsgMngmt" runat="server" OnTick="tmMsgMngmt_Tick" Interval="10000"></asp:Timer>

The code binding data called from tmMsgMngmt_Tick

        //List of all areas
        List<MessageAllArea> lstAreaStatus = messageArears.GetAreaStatus();
        Session.Add("AllArea", lstAreaStatus);
        //List of affected areas
        List<MessageAllArea> lstAffectedArea = messageArears.GetAffectedArea();
        Session.Add("AfectedArea", lstAffectedArea);
        //List of affected areas
        List<MessageAllArea> lstLdshedding = messageArears.GetLoadShedding();
        Session.Add("LoadShdArea", lstLdshedding);

        ltvData.DataSource = lstAreaStatus;
        ltvData.DataBind();
        //Populate Area drop down list
        ddlLoadMessages.Items.Clear();
        if (lstAreaStatus.Count > 0)
        {
            foreach (MessageAllArea item in lstAreaStatus)
            {
                int attNo = int.Parse(item.attnFlag);
                if (attNo == 1)
                {
                    ddlLoadMessages.Items.Add(new ListItem(item.Area, item.AreaId));
                }
            }
        }
    }

When this error is encountered IIS seems to hang. It only happens to our users intermittently, and we have been unable to reproduce it in our development environment. Subsequent page requests from the same user can take as long as twenty minutes to be processed.

1 Answers1

0

So the reason this error occurred was because the dropdownlist control, ddlLoadMessages was being modified by the asp:Timer's tick event and the ddlLoadMessages control was not located inside the relevant UpdatePanel. This made the .NET validation engine not aware of where the changes were coming from for the dropdown list which causing errors.

I haven't been able to determine why this would cause subsequent pages to take longer to load yet however.

Edit - it seems as if this was not the true source of the issue where pages would take a long time to load. Our website still seems to hang whenever ANY unhandled exceptions are encountered.

Edit 2 - finally found the true source of the issue, we were using an older version of .NET Framework 4.5 that had a bug where some requests would freeze at the RequestAcquireState unexpectedly, see:

ManagedPipelineHandler for an AJAX POST crashes if an IE9 user navigates away from a page while that call was in progress

Installing a latest .NET 4.5 Framework solved the issue.

Community
  • 1
  • 1