RenderController should support async/await downstream #14715
mortenbock
started this conversation in
Features and ideas
Replies: 1 comment 1 reply
-
That will be super breaking to change that signature. IIRC you can add the signature in your superclass and add a [NonAction] attribute. Then you can next to it have an async version and the original sync-version will be ignored. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When inheriting
RenderController
the Index method is implemented in a "sync" pattern.https://github.com/umbraco/Umbraco-CMS/blob/3f6ebe7656d6ded634db2c268a4b60d11fa076c7/src/Umbraco.Web.Common/Controllers/RenderController.cs#L47C1-L50
This means that any downstream code that needs to do async IO work will have to block the threads with
.Result
or similar, which can (and have) lead to thread pool exhaustion, deadlocks and general performance issues.So, as a suggestion, the method signature should be something like:
Beta Was this translation helpful? Give feedback.
All reactions