Skip to content

Commit

Permalink
fix sched_setaffinity failed.
Browse files Browse the repository at this point in the history
  • Loading branch information
JinheLin authored and ti-chi-bot committed Jul 25, 2022
1 parent f11c6c4 commit 91906ee
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 91906ee

Please sign in to comment.