Skip to content
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

Consider adding ConfigureAwait(false) #10915

Closed
roji opened this issue Feb 8, 2018 · 3 comments
Closed

Consider adding ConfigureAwait(false) #10915

roji opened this issue Feb 8, 2018 · 3 comments

Comments

@roji
Copy link
Member

roji commented Feb 8, 2018

After our discussion, it seems that the omission of ConfigureAwait(false) doesn't actually prevent all race conditions which could be produced in a UI application. In other words, if a user clicks twice on a button, then two SaveChangeAsync() invocations could be attempted at the same time, resulting in an exception. The only way around this would be for the user to make sure their application doesn't call EF APIs while another call is still in progress (i.e. by graying out buttons before starting the first request).

If ConfigureAwait(false) is added, then it's still an open question whether user callbacks should be executed in the user's synchronization context or in the thread pool (e.g. setting properties while materializing entities).

There's a good possibility this would be a breaking change - to be evaluated.

Related to #10914.

@ajcvickers ajcvickers added this to the Breaking Changes milestone Feb 13, 2018
@ajcvickers
Copy link
Contributor

We want to reconsider this and talk to people to understand better whether we should do it before...

@roji
Copy link
Member Author

roji commented May 19, 2018

Any reason for closing this, especially now that the 3.0 milestone has been announced?

It's true that there's still the open question of calling user callbacks (i.e. entity properties during materialization) with the synchronization or not, but at the very least I imagine there's quite a bit of internal EF Core code which could be executed on the thread pool instead of on the UI thread?

@roji
Copy link
Member Author

roji commented Oct 21, 2021

Note: this was done in #10164

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants