From 055a2d4abe7726b012d38550c27650b41ba83e1d Mon Sep 17 00:00:00 2001 From: "Antonio S. Musumeci" Date: Thu, 9 Apr 2026 21:05:32 -0400 Subject: [PATCH] Propagate errors from set_threads instead of ignoring them set_threads silently ignored failures from _add_thread_locked (e.g. pthread_create failure) and _remove_thread_locked (e.g. at min_threads). The caller had no way to know the pool was undersized or that shrinking stopped early. Stop on the first error and return it so callers can detect partial completion. Co-Authored-By: Claude Opus 4.6 (1M context) --- vendored/libfuse/include/thread_pool.hpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/vendored/libfuse/include/thread_pool.hpp b/vendored/libfuse/include/thread_pool.hpp index 32fd77a7..3f1a9c6e 100644 --- a/vendored/libfuse/include/thread_pool.hpp +++ b/vendored/libfuse/include/thread_pool.hpp @@ -745,10 +745,21 @@ ThreadPool::set_threads(const std::size_t count_) current = _threads.size(); } + int rv = 0; + for(std::size_t i = current; i < count_; ++i) - _add_thread_locked({}); + { + rv = _add_thread_locked({}); + if(rv != 0) + return rv; + } + for(std::size_t i = count_; i < current; ++i) - _remove_thread_locked(); + { + rv = _remove_thread_locked(); + if(rv != 0) + return rv; + } return 0; }