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

Sitelet.Embed may cause deadlock since it uses Async.RunSynchronously #355

Closed
radekm opened this Issue Feb 26, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@radekm

radekm commented Feb 26, 2015

Sitelet.Embed calls Content.ToResponse which calls Async.RunSynchronously. If the call to Async.RunSynchronously happens in the thread with AspNetSynchronizationContext and asynchronous action uses Async.SwitchToContext to ensure AspNetSynchronizationContext then the program deadlocks.

This can be fixed by using Content.CustomContentAsync and Content.ToResponseAsync in Sitelet.Embed instead of Content.CustomContent and Content.ToResponse.

@Tarmil

This comment has been minimized.

Member

Tarmil commented Feb 27, 2015

Thanks for the catch! I don't know what I was thinking when I wrote this.

@Tarmil Tarmil closed this in 725a439 Feb 27, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment