Skip to content

Allow graceful handling of cpuinfo init failure #10826

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

Merged
merged 1 commit into from
May 13, 2025
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
6 changes: 5 additions & 1 deletion extension/threadpool/threadpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ void ThreadPool::run(
// get_threadpool is not thread safe due to leak_corrupted_threadpool
// Make this part threadsafe: TODO(kimishpatel)
ThreadPool* get_threadpool() {
ET_CHECK_MSG(cpuinfo_initialize(), "cpuinfo initialization failed");
if (!cpuinfo_initialize()) {
ET_LOG(Error, "cpuinfo initialization failed");
return nullptr; // NOLINT(facebook-hte-NullableReturn)
}

int num_threads = cpuinfo_get_processors_count();
/*
* For llvm-tsan, holding limit for the number of locks for a single thread
Expand Down
Loading