Skip to content
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

fix sched_setaffinity failed. #5459

Merged
merged 2 commits into from
Jul 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions dbms/src/Storages/DeltaMerge/ReadThread/SegmentReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,13 @@ class SegmentReader
int ret = sched_setaffinity(0, sizeof(cpu_set), &cpu_set);
if (ret != 0)
{
LOG_FMT_ERROR(log, "sched_setaffinity fail: {}", std::strerror(errno));
throw Exception(fmt::format("sched_setaffinity fail: {}", std::strerror(errno)));
// It can be failed due to some CPU core cannot access, such as CPU offline.
LOG_FMT_ERROR(log, "sched_setaffinity cpus {} fail: {}", cpus, std::strerror(errno));
}
else
{
LOG_FMT_DEBUG(log, "sched_setaffinity cpus {} succ", cpus);
}
LOG_FMT_DEBUG(log, "sched_setaffinity cpus {} succ", cpus);
#endif
}

Expand Down