-
Notifications
You must be signed in to change notification settings - Fork 9
Issue 68: Graceful shutdown with outstanding IO #109
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
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #109 +/- ##
===========================================
+ Coverage 61.68% 80.34% +18.65%
===========================================
Files 15 17 +2
Lines 462 1175 +713
Branches 35 128 +93
===========================================
+ Hits 285 944 +659
- Misses 158 166 +8
- Partials 19 65 +46 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
if (vol->is_destroying() || is_shutting_down()) { | ||
LOGE( | ||
"Can't serve write, Volume {} is_destroying: {} is either in destroying state or System is shutting down. ", | ||
vol->id_str(), vol->is_destroying()); | ||
return folly::makeUnexpected(VolumeError::UNSUPPORTED_OP); | ||
} | ||
|
||
vol->inc_ref(); |
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.
Isnt it better to keep the inc_ref also inside the volume ?
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 put it here on purpose for the flip to kick in. We can also do that inside volume, however I tend to keep the write path clean if we can keep one less flip outside of write path.
I want to make the ref_cnt cleaner anyway, so might restructure the code a little in following PR. Hope it is fine with you.
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.
lgtm
To Reviewers:
Please hide whitespaces, there is a bunch of clang-format changes that is non-logic change.
Changes:
Graceful shutdown will wait for all above outstanding requets to complete before proceed.
Testing