-
Notifications
You must be signed in to change notification settings - Fork 355
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
do not log error in the syscall crate #1973
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1973 +/- ##
==========================================
- Coverage 65.28% 65.26% -0.02%
==========================================
Files 129 129
Lines 14784 14800 +16
==========================================
+ Hits 9651 9659 +8
- Misses 5133 5141 +8 |
50d0306
to
4dbf3c0
Compare
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.
What about tracing at the caller? It is beyond the role of the syscall mod to determine the type of error.
4dbf3c0
to
802ae7a
Compare
I made the change for |
I agree with you. we should do it. |
@@ -489,13 +490,7 @@ impl Syscall for LinuxSyscall { | |||
flags: MsFlags, | |||
data: Option<&str>, | |||
) -> Result<()> { | |||
mount(source, target, fstype, flags, data).map_err(|err| { | |||
tracing::error!( |
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.
Is there any need to bring this tracing to the callers?
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.
Yes, 47bc859
c50e0ef
to
47bc859
Compare
Signed-off-by: yihuaf <[email protected]>
Signed-off-by: yihuaf <[email protected]>
Signed-off-by: yihuaf <[email protected]>
Signed-off-by: yihuaf <[email protected]>
47bc859
to
ecf9f8d
Compare
@utam0k since this PR hasn't been merged, I went ahead and clean up the syscall crate as well. All the simpler wrappers no longer log error and logs only at the caller site. I kept the other more complex functions such as |
Signed-off-by: yihuaf <[email protected]>
Signed-off-by: yihuaf <[email protected]>
@utam0k Can we get a review if you have some time? I would like to merge this since this will unblock the integration validation test. I would also ask if it is possible to merge this in as is and address any reviews in a follow up PR since the integration validation CI is failing. |
Hey @yihuaf I think utam0k is unwell, so I'll take a look at this instead. The changes look ok, and as you said, if there are any issues, we can fix them in follow up PR. The only question I have is that this was opened because we logged errors in |
@YJDoc2 Thank you for taking a look. So issue that caused the integration failure is the I believe all the tracing add you see are at the caller of I will also add one more commit to trigger the |
MsFlags::MS_BIND | MsFlags::MS_REC, | ||
None, | ||
) | ||
.map_err(|err| { |
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.
For example, this call to syscall::mount
is inside the rootfs
module. Here, mount call failure indicates an actual failure, so we log the error here.
Hey @yihuaf Thanks for the detailed explanation! I think I got the actual call site and implementation mixed up originally. This looks good then, and once the CI pass, I'll approve and merge. Thanks a lot! |
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 👍
Related to #1974. The integration tests uses
stderr
to check if there are any errors. However, there are a number of cases where we want to mount with ENOTDIR or ENOENT error but we ignore these errors. Therefore, we do not want to log these errors. Otherwise the integration tests would be broken.tag along: Bump rust version to 1.70 and fix some comments lint in integration test. As a side effect, this will trigger the integration validation test, so we can test the fix is actually working in CI.