-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add Flag to Reset the DB on Shutdown. #202
Conversation
Thank you so much for the contribution @favalos! I have one (hopefully) small change to ask. The shutdown function on the api/aio interfaces are used as a signal to begin a graceful shutdown. The aio method is currently unused, but we do use it on the api side. When this signal is received we stop taking new requests but continue to process any sqes/cqes already in the system until all are complete. As such we can't reset the database via the shutdown function as we still need to write to the database after this function has been called. You can see the shutdown process here.
I recommend moving the call to Reset (if the flag is true) the Stop function, this is when we can safely reset. |
Hi @dfarr, Thanks for the detailed explanation, I did the changes accordingly. Let me know if that looks fine. |
Thank you @favalos for contributing to resonate !!! |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #202 +/- ##
==========================================
- Coverage 64.85% 64.81% -0.05%
==========================================
Files 83 83
Lines 8829 8841 +12
==========================================
+ Hits 5726 5730 +4
- Misses 2709 2715 +6
- Partials 394 396 +2 ☔ View full report in Codecov by Sentry. |
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.
Looks great! Thank you @favalos
Closes #97 |
Pull request to add the flag discussed in #97.
I had to add a reset flag to every DB configuration and change the Reset implementation.
Other approach could be doing the implementation on the Shutdown method, but that would imply to add a new
Resetable() bool
method to the subsystem interface.Please let me know your comments.