Skip to content
This repository has been archived by the owner on Dec 13, 2021. It is now read-only.

Ditto processor attributes require a DittoProcessorMetaData attribute to be applied to the class but none was found. #238

Closed
garpunkal opened this issue Aug 21, 2018 · 36 comments · Fixed by #241
Assignees
Labels

Comments

@garpunkal
Copy link

garpunkal commented Aug 21, 2018

Hi,

We've started to see this exception being raised on application startup and first render. If you reload the browser window, the exception doesn't trigger:

Ditto processor attributes require a DittoProcessorMetaData attribute to be applied to the class but none was found.

Exception / StackTrace
at Our.Umbraco.Ditto.DittoProcessorAttribute..ctor()
   at Jaywing.Web.Models.Processors.UrlOrRedirectUrlAttribute..ctor(Boolean absoluteUrl) in \Models\Processors\UrlOrRedirectUrlAttribute.cs:line 11
   at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
   at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimePropertyInfo property, RuntimeType caType)
   at System.Attribute.InternalGetCustomAttributes(PropertyInfo element, Type type, Boolean inherit)
   at Our.Umbraco.Ditto.DittoTypeInfo.Create(Type type)
   at Our.Umbraco.Ditto.DittoTypeInfoCache.GetOrAdd(Type type)
   at Our.Umbraco.Ditto.PublishedContentExtensions.As(IPublishedContent content, Type type, CultureInfo culture, Object instance, IEnumerable1 processorContexts, Action1 onConverting, Action1 onConverted, DittoChainContext chainContext)
   at Our.Umbraco.Ditto.RecursiveDittoAttribute.ProcessValue()
   at Our.Umbraco.Ditto.DittoCacheableAttribute.GetCacheItem[TOuputType](DittoCacheContext cacheContext, Func1 refresher)
   at Our.Umbraco.Ditto.PublishedContentExtensions.DoGetProcessedValue(IPublishedContent content, DittoTypePropertyInfo mappableProperty, DittoProcessorContext baseProcessorContext, DittoChainContext chainContext)
   at Our.Umbraco.Ditto.PublishedContentExtensions.GetProcessedValue(IPublishedContent content, CultureInfo culture, DittoTypeInfo config, DittoTypePropertyInfo mappableProperty, Object instance, DittoChainContext chainContext)
   at Our.Umbraco.Ditto.PublishedContentExtensions.ConvertContent(IPublishedContent content, DittoTypeInfo config, CultureInfo culture, Object instance, Action1 onConverting, Action1 onConverted, DittoChainContext chainContext)
   at Our.Umbraco.Ditto.PublishedContentExtensions.As(IPublishedContent content, Type type, CultureInfo culture, Object instance, IEnumerable1 processorContexts, Action1 onConverting, Action1 onConverted, DittoChainContext chainContext)
   at Our.Umbraco.Ditto.PublishedContentExtensions.As[T](IPublishedContent content, CultureInfo culture, T instance, IEnumerable1 processorContexts, Action1 onConverting, Action1 onConverted, DittoChainContext chainContext)
   at Our.Umbraco.Ditto.DittoViewModel1.get_View()
   at ASP._Page_Views_Partials_Header_cshtml.Execute() in Views\Partials\Header.cshtml:line 4
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
   at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
   at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
   at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData)
   at Umbraco.Web.CacheHelperExtensions.CachedPartialView(CacheHelper cacheHelper, HtmlHelper htmlHelper, String partialViewName, Object model, Int32 cachedSeconds, String cacheKey, ViewDataDictionary viewData)
   at Umbraco.Web.HtmlHelperRenderExtensions.CachedPartial(HtmlHelper htmlHelper, String partialViewName, Object model, Int32 cachedSeconds, Boolean cacheByPage, Boolean cacheByMember, ViewDataDictionary viewData, Func3 contextualKeyBuilder)
   at ASP._Page_Views_Master_cshtml.Execute() in Views\Master.cshtml:line 33
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
   at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
   at System.Web.WebPages.WebPageBase.<>c__DisplayClass3.<RenderPageCore>b__2(TextWriter writer)
   at System.Web.WebPages.WebPageBase.Write(HelperResult result)
   at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action1 body)
   at System.Web.WebPages.WebPageBase.PopContext()
   at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
   at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)

I'm using a very simple processor:

public class UrlOrRedirectUrlAttribute : DittoProcessorAttribute
{
    private bool AbsoluteUrl { get; }

    public UrlOrRedirectUrlAttribute(bool absoluteUrl = false)
    {
        AbsoluteUrl = absoluteUrl;
    }

    public override object ProcessValue()
    {
        var content = Value as IPublishedContent;
        return content?.GetUrl(Shared.StaticValues.DocumentTypes.Redirect, Shared.StaticValues.Properties.RedirectUrl, AbsoluteUrl);
    }
}

Any help would be great.

@leekelleher leekelleher self-assigned this Aug 21, 2018
@leekelleher
Copy link
Collaborator

@garpunkal I've not been able to reproduce this issue so far.

Can I check if you have recompiled your code against the upgrade Ditto assembly? or was it a drop in the /bin folder update?
(just thinking if there's a scenario I'm not considering here)

@Nicholas-Westby
Copy link

This has happened to me too. Refreshing the page usually seems to fix it (though a coworker mentioned he needed to restart IIS). Here's the processor it originates from (at least, this was the latest one):

// Namespaces.
using Archetype.Models;
using Contexts;
using Our.Umbraco.Ditto;
using Rhythm.Umbraco.Archetype;
using System;
using System.Linq;
using Types;
using Utilities;

/// <summary>
/// This processor returns a collection of links.
/// </summary>
[AttributeUsage(validOn: AttributeTargets.Property, AllowMultiple = true)]
[DittoProcessorMetaData(ContextType = typeof(ContentDataContext))]
public class LinksAttribute : UmbracoPropertyAttribute
{

	#region Methods

	/// <summary>
	/// Returns the links.
	/// </summary>
	/// <returns>
	/// The links.
	/// </returns>
	public override object ProcessValue()
	{
		var casted = Context as ContentDataContext;
		var currentPage = casted?.Page;
		var currentNode = casted?.DataContent;
		var archetype = Value as ArchetypeModel;
		var fieldsets = archetype?.EnabledFieldsets();
		if (fieldsets == null)
		{
			return Enumerable.Empty<Link>();
		}
		var links = fieldsets.Select(x => LinkUtility.GetLink(x, currentPage, currentNode)).ToList();
		return links;
	}

	#endregion

}

And here's a stack trace (with some details modified to protect the innocent):

Stack Trace
 2018-08-29 10:14:55,795 [P5792/D9/T56] ERROR MyProject.Application - An error was captured by OnApplicationError handler.
System.ApplicationException: Ditto processor attributes require a DittoProcessorMetaData attribute to be applied to the class but none was found.
   at Our.Umbraco.Ditto.DittoProcessorAttribute..ctor()
   at MyProject.LinksAttribute..ctor()
   at System.RuntimeTypeHandle.CreateCaInstance(RuntimeType type, IRuntimeMethodInfo ctor)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimePropertyInfo property, RuntimeType caType)
   at System.Attribute.InternalGetCustomAttributes(PropertyInfo element, Type type, Boolean inherit)
   at System.Reflection.CustomAttributeExtensions.GetCustomAttributes(MemberInfo element)
   at Our.Umbraco.Ditto.DittoTypeInfo.Create(Type type)
   at Our.Umbraco.Ditto.DittoTypeInfoCache.GetOrAdd(Type type)
   at Our.Umbraco.Ditto.PublishedContentExtensions.As(IPublishedContent content, Type type, CultureInfo culture, Object instance, IEnumerable`1 processorContexts, Action`1 onConverting, Action`1 onConverted, DittoChainContext chainContext)
   at Our.Umbraco.Ditto.DittoFactoryAttribute.<>c__DisplayClass7_0.<ProcessValue>b__2(IPublishedContent x)
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Linq.Enumerable.<CastIterator>d__97`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Rhythm.Core.CollectionExtensionMethods.AsList[T](IEnumerable`1 items)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
   at Our.Umbraco.Ditto.DittoCacheableAttribute.GetCacheItem[TOuputType](DittoCacheContext cacheContext, Func`1 refresher)
   at Our.Umbraco.Ditto.DittoMultiProcessorAttribute.ProcessValue()
   at Our.Umbraco.Ditto.DittoCacheableAttribute.GetCacheItem[TOuputType](DittoCacheContext cacheContext, Func`1 refresher)
   at Our.Umbraco.Ditto.PublishedContentExtensions.DoGetProcessedValue(IPublishedContent content, DittoTypePropertyInfo mappableProperty, DittoProcessorContext baseProcessorContext, DittoChainContext chainContext)
   at Our.Umbraco.Ditto.PublishedContentExtensions.GetProcessedValue(IPublishedContent content, CultureInfo culture, DittoTypeInfo config, DittoTypePropertyInfo mappableProperty, Object instance, DittoChainContext chainContext)
   at Our.Umbraco.Ditto.PublishedContentExtensions.ConvertContent(IPublishedContent content, DittoTypeInfo config, CultureInfo culture, Object instance, Action`1 onConverting, Action`1 onConverted, DittoChainContext chainContext)
   at Our.Umbraco.Ditto.PublishedContentExtensions.As(IPublishedContent content, Type type, CultureInfo culture, Object instance, IEnumerable`1 processorContexts, Action`1 onConverting, Action`1 onConverted, DittoChainContext chainContext)
   at Our.Umbraco.Ditto.PublishedContentExtensions.As[T](IPublishedContent content, CultureInfo culture, T instance, IEnumerable`1 processorContexts, Action`1 onConverting, Action`1 onConverted, DittoChainContext chainContext)
   MyProject.MappingUtility.MapTypicalPage(IPublishedContent currentPage, IPublishedContent currentNode, UmbracoHelper helper, UmbracoContext umbracoContext, String culture) in C:\MyProject\MappingUtility.cs:line 53
   at MyProject.AbstractDefaultPageController.GetPageAction(RenderModel model) in C:\MyProject\AbstractDefaultPageController.cs:line 78
   at MyProject.DefaultPageController.Index(RenderModel model) in C:\MyProject\DefaultPageController.cs:line 27
   at lambda_method(Closure , ControllerBase , Object[] )
   at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag)
   at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.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.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

@leekelleher
Copy link
Collaborator

Thanks @Nicholas-Westby.

I'm curious whether your code was recompiled against the upgrade Ditto assembly? or was it a drop in the /bin folder update?

@Nicholas-Westby
Copy link

Hi @leekelleher,

I'm not sure what you mean exactly, but I have a general idea. Ditto is installed with NuGet into a single project in my Visual Studio solution (which contains two projects, one for the web application and one for all the C# code). When I view the NuGet packages installed for the entire solution and filter by "ditto", this is what shows up:

The NuGet Installs in This Solution

Does that answer your question?

@Nicholas-Westby
Copy link

Also, it's Ditto 0.12.0 (in case you were wondering about the version number).

@leekelleher
Copy link
Collaborator

Cool, thanks @Nicholas-Westby, I can assume your code got recompiled against upgraded Ditto.

Hmmm, I've still not been able to reproduce this on my local environment yet. I'll investigate further.

@Nicholas-Westby
Copy link

Thanks, @leekelleher. FYI, I've only seen this error a few times. Usually on my local when developing in Visual Studio, IIRC. Though my coworker just saw it on production with IIS.

@drachele
Copy link

drachele commented Sep 6, 2018

We're also getting this error since upgrading to 0.12.0.

It's random, but usually happens on application start / on the first request to the application.

Sometimes it resolves itself, other times not.

Here's the relevant part of the stack trace:

at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) 
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) 
at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) 
at Our.Umbraco.Ditto.DittoProcessorRegistry.<GetPostProcessorAttributes>d__14.MoveNext() 
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection) 
at Our.Umbraco.Ditto.DittoTypeInfo.Create(Type type) at Our.Umbraco.Ditto.DittoTypeInfoCache.GetOrAdd(Type type) 
at Our.Umbraco.Ditto.PublishedContentExtensions.As(IPublishedContent content, Type type, CultureInfo culture, Object instance, IEnumerable`1 processorContexts, Action`1 onConverting, Action`1 onConverted, DittoChainContext chainContext) 
at Our.Umbraco.Ditto.PublishedContentExtensions.As[T](IPublishedContent content, CultureInfo culture, T instance, IEnumerable`1 processorContexts, Action`1 onConverting, Action`1 onConverted, DittoChainContext chainContext) 

Let me know if you require more information.

Cheers,
Dan.

leekelleher added a commit that referenced this issue Sep 7, 2018
When the `AttributedTypeResolver` is created, the `inherit` param wasn't being passed through.
@leekelleher
Copy link
Collaborator

I still haven't been able to reproduce this issue yet, but working through the codebase, I think I may have identified the bug. I've patched it up in 44129a6. If one of you could give it a test, that'd be much appreciated.

Umbraco & NuGet packages are available on the CI build page: https://ci.appveyor.com/project/UMCO/umbraco-ditto/build/0.12.1.20/artifacts

If all good, I'll get a patch release out. Thanks!

@drachele
Copy link

Is it possible you could push this change to a pre-release version on NuGet?

@leekelleher
Copy link
Collaborator

@drachele You could try the MyGet feed (it contains the latest builds): https://www.myget.org/feed/umbraco-packages/package/nuget/Our.Umbraco.Ditto

@Nicholas-Westby
Copy link

Testing this will be difficult, as the issue only seems to happen very seldomly. I suppose I could test it by making sure it doesn't break anything.

@drachele
Copy link

Hi @leekelleher

I've pulled the 0.12.1-alpha-000021 version into our site and it all seems to work without any issues.

Not seeing that error occur anywhere either which is a good sign!

When do you think you could release 0.12.1 to the main NuGet feed?

Cheers,
Dan.

@leekelleher
Copy link
Collaborator

Thanks for the feedback @drachele! We've been pretty blind on this issue, (since I still haven't been able to reproduce it).

We'll look schedule a release of v0.12.1 soon, (probably next week, as my client workload is heavy this week).

@leekelleher
Copy link
Collaborator

Closing this ticket off. v0.12.1 has been released.

If this issue rears its head in future, let's open a new ticket.

@drachele
Copy link

Great, thanks @leekelleher , will upgrade now and let you know how it goes...

@seb-rogers
Copy link

We just applied the 0.12.1-alpha-000021 patch to our QA site and we are still getting this issue. We are going to try with v0.12.1 now and will report back.

@leekelleher
Copy link
Collaborator

Thanks @seb-rogers. Although v0.12.1 is the same codebase as the v0.12.1-alpha-000021 build, so I expect you'll get the same result.

Let us know either way. I'm pretty much flying blind on this one (since not being able to reproduce it).

@seb-rogers
Copy link

After releasing v0.12.1 the issue is still there, however we have narrowed it down a little. It is only happening on first load of a template after a release and when that template is loaded in 2 separate browsers at the same time.

@leekelleher
Copy link
Collaborator

Thanks @seb-rogers, useful info. I hadn't considered the concurrency issue (I briefly chatted with @tristanjthompson about it last night). I've been able to reproduce the bug now.

Re-opening this ticket.

@leekelleher
Copy link
Collaborator

@tristanjthompson @seb-rogers I've added a patch, see PR #241 for details. I was able to reproduce the bug before, since my patch, it no longer throws the error.

@drachele
Copy link

Ship it! 😃

@leekelleher
Copy link
Collaborator

@drachele You say it like it's a 2 minute job, haha 😆 There's a fair amount of love that goes into every release, takes time.

It helps me more if someone could verify that the fix works for them: https://ci.appveyor.com/project/UMCO/umbraco-ditto/build/0.12.2.29/artifacts ❤️ 👍

@drachele
Copy link

If you could push it to the MyGet feed, I can pull it into my site and try and reproduce (again).

@leekelleher
Copy link
Collaborator

@drachele The MyGet feed only has packages that are built from the 'develop' branch, my patch is in a PR, (since I'm not 100% that my code isn't gonna break something). BUT the PR is build and the AppVeyor CI does support a custom NuGet feed, if that works for you? Here it is... https://ci.appveyor.com/nuget/umbraco-ditto-qq37it3txy7g

@drachele
Copy link

@leekelleher Okay great, will give that a go and report back shortly.

@drachele
Copy link

@leekelleher I've pulled your patched version in our (rather large and complex) site.

Site is working fine, and I'm unable to reproduce the issue using the steps outlined above.

Things I've done to try and reproduce:

  • Rebuild site and attempt to open two different pages at the same time in two different browsers
  • Do an "iisreset" and attempt to open two different pages at the same
  • Restart the app by modifying the web.config and do the same

Is there anything else you would like me to try to reproduce the issue?

@leekelleher
Copy link
Collaborator

@drachele Cool, thanks for testing it out! Those are the scenarios that I was able to reproduce the original bug with, not sure what else to try, so sounds fine to me. Cheers.

Spoke with @tristanjthompson (via Slack) and his team are testing it out too.

@tristanjthompson
Copy link

Thanks @leekelleher! The way we could easily replicate is to clean the solution, do a build and then open the same page in our site concurrently in several tabs. With the patch applied, I'm no longer getting the error! However, if I have debug=true in my web.config, I'm getting a couple of different errors on initial page load - sometimes to do with MiniProfiler, but one to do with converting;

Unable to cast object of type 'Dyson.Careers.Models.CallToActionModel[]' to type 'System.Collections.Generic.IEnumerable`1[Umbraco.Core.Models.IPublishedContent]'.

That particular property/Ditto attribute is on a model class which is attached the main view model.

However, with debug=false (which is what it will be when it's live), I never get any exceptions.

@tristanjthompson
Copy link

Hmm, only getting the MiniProfiler error in there now - maybe the casting is a red herring and to do with our specific implementation. I'm not that worried about it as it won't happen on live either way. I'll have a look into whether I can track down where the MiniProfiler error is coming from

@SimonHartfield
Copy link

Sorry to push and I know the answer is likely "when I have a free second" but any idea when this will be released ?

@leekelleher
Copy link
Collaborator

@SimonHartfield I'm back from holiday now, but the follow up (from others) on this patch was that it caused errors with MiniProfiler. Are you - or others - experiencing this too? (I assume not)

@tristanjthompson
Copy link

@leekelleher - I had this when I used the latest patch, however, with debug mode disabled (as it usually is on production) it doesn't happen. Personally, I'd say that the patch version is better than the current one as it shouldn't cause issues on production (assuming debug is switched off) and will only occur in dev during startup under certain circumstances (which is what's happening at the moment)...so without going to the effort of refactoring all the usages of MiniProfiler to be threadsafe (which is what I assume the issue is!), this might be a good first step to resolve the problem if that's the only thing people have noticed? What does everyone else think?

@leekelleher
Copy link
Collaborator

Thanks @tristanjthompson.

I have been considering removing all the MiniProfiler timers from Ditto, at one time I thought they were a big performance bottleneck, but could never prove it.

I guess an approach is to do a point release with this patch, and prepare for any MiniProfiler issues? If that's good with everyone else on this ticket? (Since I can't reproduce the issue myself)

@leekelleher
Copy link
Collaborator

Heads up that I'm going to release v0.12.2 today.

I'm not 100% convinced that this fixes the underlying concurrency issue, but I'm unable to reproduce it on my test sites, so it's better than it was. The reason I flag this is that if there are any issues (specifically for anyone involved in this thread), then I'd really appreciate your collaboration on working towards a fix. Thanks!

@spideywebdesign
Copy link

Having been suffering with this exact issue, I can confirm that having updated to 0.12.2 has fixed it for me.

Again, I was able to reproduce by restarting my app and loading both sites in a multi site setup in separate tabs simultaneously.

Thanks @leekelleher !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

8 participants