-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Orchard Core can cause dependency resolution problems due to use of async code in non-async context #17547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The root of this is options not supporting async: dotnet/runtime#97575. However, perhaps we can work around this with our |
Could you where this thread is at? That could help understand why it's blocked? It should not be because of the async call. |
I'm not sure if it is related but I often see the following error in the logs:
|
It seems that this issue didn't really move for quite a while despite us asking the author for further feedback. Is this something you'd like to revisit any time soon or should we close? Please reply. |
Just noticed that this is "waiting for author feedback". I thought I'd already provided as much information as I could. |
Would you be able to try the latest preview release? We fixed some bugs in the database layer. Also, could you rephase the problem? I am not finding what problem you are actually facing, like an exception, or the app is not responding ... It seems you only shared logs without symptoms. |
The original problem was that dependency injection of ISession and IContentManager would result in request time-outs. It doesn't happen 100% of the time but it would happen intermittently, particularly on the first request after startup. The screenshots above depict one such occasion. |
It seems that this issue didn't really move for quite a while despite us asking the author for further feedback. Is this something you'd like to revisit any time soon or should we close? Please reply. |
We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues). This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here. |
Great news! |
@jimitndiaye I am not very optimistic that the change would be solving your issue, but I may be wrong. I'd love if you could try it and tell us if that changed anything. |
Is it released? Or would I need to switch to the preview releases? |
It's currently in preview only, I'm not sure if it is possible to easily back port to 2.x. /cc @MikeAlhayek What do you think? |
Describe the bug
I've been experiencing request timeouts caused by what seemed to be dependency injection problems but turned out to be a result of executing async code within OrcardCore as synchronous. Specifically, in OrchardCore.DynamicCache.CacheOptionsConfiguration.Configure:
This is resulting in blocking when resolving types like IContentManager.
I originally posted this in the OrchardCore discord but was advised to raise this issue on Github.
Orchard Core version
2.1.6
To Reproduce
I don't have isolated code to reproduce it but this is a blazor server app and I have a service registered with
AddScoped
that hasIContentManager
andISession
as dependencies. This issue doesn't happen 100% of the time but it happens fairly often, especially on the first request to the hosting page after startup.Expected behavior
IContentManager
andISession
should be resolved consistently without blocking.Logs and screenshots
Debugging in Visual studio with Just-my-code disabled revealed the following:
The origin is this line here:
The text was updated successfully, but these errors were encountered: