-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 race condition on stop #1081
base: master
Are you sure you want to change the base?
Fix race condition on stop #1081
Conversation
27cb70f
to
0444177
Compare
7fc1474
to
dd0ddf9
Compare
@@ -10,7 +10,7 @@ public class SqliteCollection : ICollectionFixture<SqliteSetup> | |||
|
|||
public class SqliteSetup : IDisposable | |||
{ | |||
public string ConnectionString { get; set; } | |||
public static string ConnectionString { get; set; } |
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.
Why does this need to be made static?
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 wanted to have simple access to the value from the new SqliteStopScenario
as well as aligning it with the way all the other scenario setups have static connection strings.
645d7f6
to
fa4f738
Compare
If the host is stopped as soon as WorkflowCompleted LifeCycleEvent is raised, some persistence providers cannot persist the 'Completed' state in time.
Do not pass global CancellationToken to persistence operations on host shutdown. This way it is ensured that persistence operations are not cancelled.
fa4f738
to
f150cd4
Compare
Sorry for taking so long. I removed everything that was not strictly necessary to make the new tests pass. |
Describe the change
No longer pass the global
CancellationToken
to persistence operations that could take place after initiating a host shutdown. This prevents cancelling workflows or stopping the host from cancelling writing persistence operations and thus losing data.Fixes #953
Fixes #1032
Describe your implementation or design
Removed the
CancellationToken
parameter from persistence operations infinally
blocks whereTaskCancelledExceptions
could be handled.Tests
Yes. I reproduced the issue by adding a
StopScenario
for persistence providers. After the change, this scenario passes.Breaking change
No.