-
Notifications
You must be signed in to change notification settings - Fork 90
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
tolerate fallocate failure and print IO error in debug form #225
Conversation
Signed-off-by: tabokie <[email protected]>
Signed-off-by: tabokie <[email protected]>
src/env/default.rs
Outdated
@@ -152,18 +152,14 @@ impl LogFd { | |||
}); | |||
#[cfg(target_os = "linux")] | |||
{ | |||
fcntl::fallocate( | |||
let _ = fcntl::fallocate( |
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 not return
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.
Not supported on some platforms. And we call it only for performance reason, skipping it is okay (e.g. already skipped on macos).
Signed-off-by: tabokie <[email protected]>
Signed-off-by: tabokie <[email protected]>
Signed-off-by: tabokie <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #225 +/- ##
==========================================
- Coverage 97.16% 97.12% -0.05%
==========================================
Files 29 29
Lines 9007 9030 +23
==========================================
+ Hits 8752 8770 +18
- Misses 255 260 +5
Continue to review full report at Codecov.
|
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
Signed-off-by: tabokie <[email protected]>
* tolerate fallocate failure and print IO error in debug form Signed-off-by: tabokie <[email protected]> * update CHANGELOG.md Signed-off-by: tabokie <[email protected]> * only tolerate e=95 Signed-off-by: tabokie <[email protected]> * still tolerate unconditionally Signed-off-by: tabokie <[email protected]> * update doc Signed-off-by: tabokie <[email protected]> * add a failpoint test Signed-off-by: tabokie <[email protected]>
) * tolerate fallocate failure and print IO error in debug form Signed-off-by: tabokie <[email protected]> * update CHANGELOG.md Signed-off-by: tabokie <[email protected]> * only tolerate e=95 Signed-off-by: tabokie <[email protected]> * still tolerate unconditionally Signed-off-by: tabokie <[email protected]> * update doc Signed-off-by: tabokie <[email protected]> * add a failpoint test Signed-off-by: tabokie <[email protected]>
fallocate
is more performant but not supported on some platforms. This patch ignores its error.Also fix the issue that
std::io::Error
doesn't print well for custom error kind.Signed-off-by: tabokie [email protected]