dd4t / DD4T.Core

DD4T Core delivery framework for Microsoft.NET
Apache License 2.0
4 stars 14 forks source link

DD4T ComponentPresentationFactory - Caching issue #112

Closed Shiva85 closed 4 years ago

Shiva85 commented 7 years ago

During performance testing, I am hitting the following issue when the load increases on my presentation servers for DCPs.

2017-04-21 00:06:38,419 [9] ERROR - Internal Server Error System.Web.HttpException (0x80004005): Internal Server Error ---> System.IndexOutOfRangeException: Index was outside the bounds of the array. at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at DD4T.Utils.DD4TConfiguration.GetExpirationForCacheRegion(String region) at DD4T.Utils.Caching.DefaultCacheAgent.FindCacheItemPolicy(String key, Object item, String region) at DD4T.Utils.Caching.DefaultCacheAgent.Store(String key, String region, Object item, List1 dependOnTcmUris) at DD4T.Factories.ComponentPresentationFactory.TryGetComponentPresentation(IComponentPresentation& cp, String componentUri, String templateUri) at Sdl.Web.Tridion.Mapping.DefaultProvider.GetEntityModel(String id, Localization localization) at MYWEBSITE.Site.MINE.Controllers.MYCONTROLLER.RENDERDCPWITHHTML(String id) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.b39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.b3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>cDisplayClass48.b41() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>cDisplayClass21.<>cDisplayClass2b.b1c() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>cDisplayClass21.b1e(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) at System.Web.Mvc.Controller.b1d(IAsyncResult asyncResult, ExecuteCoreState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.b__5(IAsyncResult asyncResult, ProcessRequestState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

I am running into the following issue with DXA 1.2 and DD4T master version. I did see a couple of issues with DD4T code and seem to have the fixes in my source as well.

I do have the fix incorporated with https://github.com/dd4t/DD4T.Core/issues/91 at https://github.com/dd4t/DD4T.Core/blob/master/source/DD4T.Utils/DD4TConfiguration.cs and also for https://github.com/dd4t/DD4T.Core/issues/96 at https://github.com/dd4t/DD4T.Core/blob/master/source/DD4T.Factories/ComponentPresentationFactory.cs

Am I missing anything? The issue occurs sporadically but still an issue!

StackExchange Question is https://tridion.stackexchange.com/questions/17065/dd4t-componentpresentationfactory-caching-issue. Are the issues listed above closed?

quirijnslings commented 4 years ago

It is a bit embarrassing to respond to this after 2 years, but am I correct in thinking that this has been resolved in the mean time? I just spammed by test server with 500,000 requests in 30 minutes, and did not see this issue.