-
Notifications
You must be signed in to change notification settings - Fork 440
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
Fix migrations service in playground #2351
Conversation
You can call If you remove the transaction you'll need to remove the execution strategy as well, since retrying in case of a failure will only make it worse. This is tracked in dotnet/efcore#22616 |
The retry is there to keep retrying until the database server container is running. Database creator worked and I've re-added the transaction. Please take another look. |
if (!await dbCreator.ExistsAsync(cancellationToken)) | ||
{ | ||
await dbCreator.CreateAsync(cancellationToken); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd move these to a separate .ExecuteAsync
call, since they could use up all retries while waiting for the container to start and if there's any delay creating the database BeginTransactionAsync
will just fail without retrying.
dc1ad0a
to
0e3afab
Compare
Fixes #2308
Creating a transaction failed if starting from a blank slate because there isn't a database to create a transaction on. Removing the transaction fixes this problem.
However, it would be ideal to keep the transaction to make this safe to transient errors. To follow best practice, we need to:
@AndriySvyryd How do you instruct EF to just create the database? I looked at
DbContext.Database.EnsureCreatedAsync
, but it also creates tables.Microsoft Reviewers: Open in CodeFlow