Skip to content

Commit

Permalink
fix sched_setaffinity failed. (#5459) (#5461)
Browse files Browse the repository at this point in the history
close #5457
  • Loading branch information
ti-chi-bot authored Jul 26, 2022
1 parent f11c6c4 commit aa50505
Showing 1 changed file with 6 additions and 3 deletions.
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

0 comments on commit aa50505

Please sign in to comment.