-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Ignore exception when checking for cgroupsv2 #64118
Ignore exception when checking for cgroupsv2 #64118
Conversation
base/base/cgroupsv2.cpp
Outdated
catch (...) | ||
{ | ||
return false; /// e.g. permission denied exception |
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.
May be we should explicitly catch std::filesystem error and check for error code permission denied and only in this case return false and otherwise throw?
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.
You are right that catching ...
is too coarse.
fs::filesystem::exists
throws:
std::filesystem::filesystem_error
for "underlying API issues" (docs) e.g. wrong permissions. We should catch and ignore any of these without logging as most callers provide a fallback to cgroups v1.std::bad_alloc
for OOMs andstd::exception
for everything else. We should let these simply bubble up.
This is an automated comment for commit 6f56642 with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page
Successful checks
|
Fixes #64107
Changelog category (leave one):