Hashtable error. Load factor too high. - asp.NET 4.0 MVC3

We have an ASP.NET 4.0 MVC3 application running on F5 load balanced servers.

We got the exception below. We do not do multithreading in our web application, but we don’t know if F5 load balancing servers can factor into the equation. We see where the exception occurs in earlier versions of .NET (most of the other messages relate to .NET 2.0 and 3.5). Has anyone experienced this issue with .NET 4.0?

The exception makes the application unusable, because when you log in, no page can be loaded without an exception.

Other links already reviewed:

2012-02-02 06: 01: 42,671 [26] FATAL System [(null)] - an unhandled exception occurred in the XYZ application. System.InvalidOperationException: Hashtable failed. The load factor is too high. The most common reason is multiple hashtable threads simultaneously. in System.Collections.Hashtable.Insert (Object key, Object nvalue, Boolean add) in System.ComponentModel.TypeDescriptor.NodeFor (type Type, Boolean createDelegator) in System.ComponentModel.TypeDescriptor.GetProvider (type type) in System.Component DataAnnotations.AssociatedMetadataTypeTypeDescriptionProvider..ctor (Type type) in System.Web.Mvc.ModelBinderDictionary.GetBinder (Type modelType, IModelBinder fallbackBinder) with System.Web.Mvc.ControllerActionInvoker.GetModelBcript. ParameterVer.Wemeter ParameterDorveVervice.Doc.Vermeter. ParameterDescription.Vermeter.Vervice.Document parameter. GetParameterValue (ControllerContext controllerContext, ParameterDescriptor parameterDescriptor) in System.Web.Mvc.ControllerActionInvoker.GetParameterValues ​​(ControllerContext controllerContext, ActionDescriptor actionDescriptor) in System.Web.Mvc.ControllerActionConvononqueme.vvoncodeonvone .Controller.ExecuteCore () in System.Web.Mvc.C ontrollerBase.Execute (RequestContext requestContext)
in System.Web.Mvc.MvcHandler <. > C__DisplayClass6 <. > C__DisplayClassb.b__5 () in System.Web.Mvc.Async.AsyncResultWrapper <. > C__DisplayClass1.b__0 () in System.Web.Mvc.MvcHandler <. > C__DisplayClasse.b__d () in System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute () on System.Web.HttpApplication.ExecuteStep (step IExecutionStep, Logical & completedSynochrome)

As you can see from the stack trace, this does not indicate a specific place in our code, which makes debugging difficult.

Any recommendations to prevent this exception from occurring are welcome.

+6
source share
2 answers

This is an unusual problem, but it happens for many people (including me). It does not seem to be associated with any specific load threshold, it simply β€œhappens”, and as soon as it does, it continues to occur more often, regardless of the load.
Solutions:
Temporary: Reset IIS and cross your fingers, this will not happen again

Permanent: get the patch from microsoft described in the KB article, or wait for the next version of .Net where it will be fixed (it is reported that it has already been fixed in 4.5 Beta)

+6
source

Mark Kim's answer in this thread: http://social.msdn.microsoft.com/Forums/en/netfxbcl/thread/172f4f77-601e-4b4f-8d98-582f8f62a98e


Hi Matt

In .NET 2.0, this error is almost always caused by multiple threads modifying the Hashtable at the same time. The fix is ​​to insert locks before modifying the Hashtable, since the Hashtable is not a multi-user thread. Another possible solution is to work with a synchronized shell through Hashtable.Synchronized, however we recommend using it for finer control.

So fix if this is your code that modifies a hashtable. Based on the information you provided, I think this is not the case. You mentioned that you are experiencing this error with the ASP 2.0 website, so this could be caused by a Hashtable downstream subscriber. For example, if the call stack looks something like this: note that this is a bug fixed for the latest version.

Thanks Kim

Stack trace: in System.Collections.Hashtable.Insert (object key, object nvalue value, logical addition) in System.Collections.Hashtable.set_Item (object key, object value) in System.ComponentModel.TypeDescriptor.CheckDefaultProvider (type type) in System.ComponentModel.TypeDescriptor.NodeFor (Type Type, Boolean createDelegator) in System.ComponentModel.TypeDescriptor.GetDescriptor (Type Type, String typeName) in System.ComponentModel.TypeDescriptor.GetAttributes (Type.Type.Table.Tablepea.Upributes). IsTypeThemeable (Type Type) in System.Web.UI.Control.ApplySkin (page page) in System.Web.UI.Control.InitRecursive (Control namingContainer) in System.Web.UI.Control.InitRecursive (Control namingContainer) in System. Web.UI.Control.InitRecursive (Control namingContainer) in System.Web.UI.Control.InitRecursive (Control namingCo ntainer) in System.Web.UI.Control.InitRecursive (Control namingContainer) in System.Web.UI.Page.ProcessRequestMain (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

0
source

Source: https://habr.com/ru/post/907492/


All Articles