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

Added .ConfigureAwait(false) to each await #525

Merged
merged 2 commits into from Aug 3, 2018

Conversation

Projects
None yet
3 participants
@xMarkos
Copy link
Contributor

xMarkos commented Aug 3, 2018

  • to prevent deadlocks, every await must be paired with .ConfigureAwait(false)

  • this is especially important when puppeteer is called from context which must wait for the task synchronously, e.g. using .GetAwaiter.GetResult() or .Result property

  • for more info about this topic check https://msdn.microsoft.com/en-us/magazine/jj991977.aspx?f=255&MSPPError=-2147217396

  • note: it is important that all devs understand why this is needed and that future code always uses ConfigureAwait(false)

Added .ConfigureAwait(false) to each await
- to prevent deadlocks, every await must be paired with .ConfigureAwait(false)
- this is especially important when puppeteer is called from context which must wait for the task synchronously, e.g. using .GetAwaiter.GetResult() or .Task property

- for more info about this topic check https://msdn.microsoft.com/en-us/magazine/jj991977.aspx?f=255&MSPPError=-2147217396

@Meir017 Meir017 requested a review from kblok Aug 3, 2018

@Meir017

Meir017 approved these changes Aug 3, 2018

@Meir017 Meir017 added the enhancement label Aug 3, 2018

@kblok

This comment has been minimized.

Copy link
Owner

kblok commented Aug 3, 2018

Great job @xMarkos!
I always considered ConfigureAwait an ugly boilerplate. But we needed this.

@kblok kblok merged commit f8b5ff5 into kblok:master Aug 3, 2018

2 checks passed

CodeFactor No issues found.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@xMarkos xMarkos deleted the xMarkos:improvements/configure-await branch Aug 3, 2018

@kblok kblok referenced this pull request Aug 9, 2018

Closed

Hang when creating PDF #414

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