From e87acf04333e939716961c0171556db23d2853fd Mon Sep 17 00:00:00 2001 From: "Antonio S. Musumeci" Date: Thu, 9 Apr 2026 20:43:21 -0400 Subject: [PATCH] Add sane defaults to ScalingConfig members ScalingConfig was value-initialized to all zeros when no config is provided. While the non-autoscale path gates all access, a zero idle_threshold_usecs would cause try_wait_dequeue_for to return immediately if the autoscale path were ever reached by mistake. Add default member initializers: min_threads=2, max_threads=64, sample_interval=100ms, cooldown=200ms, idle_threshold=5s. These match the values recommended in the scaling policy design and provide safe behavior even if a caller constructs ScalingConfig without setting all fields. Co-Authored-By: Claude Opus 4.6 (1M context) --- vendored/libfuse/include/thread_pool.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vendored/libfuse/include/thread_pool.hpp b/vendored/libfuse/include/thread_pool.hpp index 63caabb1..abf317ee 100644 --- a/vendored/libfuse/include/thread_pool.hpp +++ b/vendored/libfuse/include/thread_pool.hpp @@ -60,11 +60,11 @@ private: public: struct ScalingConfig { - std::size_t min_threads; - std::size_t max_threads; - std::int64_t sample_interval_usecs; // hill-climb sample period - std::int64_t cooldown_usecs; // min time between scaling events - std::int64_t idle_threshold_usecs; // worker idle timeout before self-exit + std::size_t min_threads = 2; + std::size_t max_threads = 64; + std::int64_t sample_interval_usecs = 100000; // 100ms hill-climb sample period + std::int64_t cooldown_usecs = 200000; // 200ms min time between scaling events + std::int64_t idle_threshold_usecs = 5000000; // 5s worker idle timeout before self-exit }; explicit