OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.37k stars 1.12k forks source link

Frequent Stack Overflows on Recipe Run #2545

Open orchardbot opened 12 years ago

orchardbot commented 12 years ago

ryang74 created: https://orchard.codeplex.com/workitem/18718

Lately, we frequently (but not always) get Stack Overflows when we run our recipe. It's infrequent enough (because we're not running recipes all the time) that we can continue working but it's concerning and quite difficult to diagnose. Below is a link to a screenshot of the Callstack repeating pattern

http://pppre.s3.amazonaws.com/2432681b7ee6c1db/f3facbc560d1420b949dc45b1368e567.jpg

If I try to trace down the call stack to something identifiable like a Content Type name, each time I get the stack overflow it's something different so it's not like we can pinpoint it to a specific type of content.

The problem comes up (it seems) when we run the recipes multiple times in a relatively short period (like within an hour). It seems less likely to occur if you wait several hours or days between recipe runs.

Note: We have a script that we run before Recipe execution to Clean Orchard by stopping IIS, deleting the AppData folder, and also deleting the corresponding folders from Temporary ASP.NET.

orchardbot commented 12 years ago

ryang74 commented:

Here's the full stack trace

orchardbot commented 12 years ago

@pszmyd commented:

"User" content item is the source of the problem. For some reason your "User" content item has CommonPart attached, but it shouldn't have. Orchard by default does not add CommonPart to a User, so it's most likely a problem with your custom code.

It looks like if the CommonPart is attached to a User, you'll always have SOE when there is an authentication cookie, but the underlying instance has been reloaded/recycled. This answers the question why you see it in relatively short periods - it happens when you don't close your browser and the app gets reloaded in the background but only if you attached CommonPart to a User type.

Btw - most SOEs I've seen in Orchard are caused by circular references between Content Manager and content handlers (not necessarily direct, as in your case) - please keep that in mind.