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

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

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
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