-
Notifications
You must be signed in to change notification settings - Fork 665
Close scheduler on module exit #2477
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
Conversation
joshua-spacetime
left a comment
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'm not sure how you would write a non-timing based regression test for this.
You could manually test it by writing a scheduled reducer that updates some counter, inserts into an auto_inc table, etc. Publishing the module with -c a few times should affect the counter's rate of change before your fix. It shouldn't have any effect after your change.
|
Not sure if this is an ideal test, but the follow was performed: Shared test setup properties:
Test 1 - Baseline:Branch
Test 2 - Pre-change:Branch
Test 3 - Post-change:Branch
If my testing methodology is valid, then it would appear that this PR change had little effect. |
|
@rekhoff do you know what the most recent values in the auto_inc column were for both tests? |
|
Okay, additional test checking against the
Upon testing the same on |
|
Okay, testing against |
|
As an extra data point, I also tested against BitCraft including running bots, and found the same behavior as described previously. |
joshua-spacetime
left a comment
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.
Thanks for testing @rekhoff!
I don't believe there was ever a bug with this code, but I'm fine to approve if you think these changes are more explicit @coolreader18.


Description of Changes
Fixes clockworklabs/SpacetimeDBPrivate#1449.Turns out we weren't ever callingModule::close(), and thus were never callingScheduler::close(). I'm still not able to actually repro the issue but if anything is the cause, this would be it. I also made it soexit().awaitwon't return until the scheduler is fully closed, so that we won't run into race conditions.Expected complexity level and risk
1
Testing