From 02703ef23934552865b59b6b5e17f1de8d91d07b Mon Sep 17 00:00:00 2001 From: "Antonio S. Musumeci" Date: Fri, 10 Apr 2026 13:34:34 -0400 Subject: [PATCH] Apply cooldown backoff on pthread_create failure When pthread_create fails (e.g., EAGAIN from OS resource limits), the monitor and fast-path pressure grow would retry on the next cycle with no delay, potentially flooding syslog with identical warnings every 100ms. Fix: stamp _last_scale_time_usecs on creation failure so the existing cooldown mechanism (200ms default) suppresses immediate retries. This reuses the scaling cooldown infrastructure rather than adding a separate backoff timer. Co-Authored-By: Claude Opus 4.6 (1M context) --- vendored/libfuse/include/thread_pool.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vendored/libfuse/include/thread_pool.hpp b/vendored/libfuse/include/thread_pool.hpp index 292f7f5b..a73cd2f5 100644 --- a/vendored/libfuse/include/thread_pool.hpp +++ b/vendored/libfuse/include/thread_pool.hpp @@ -802,6 +802,14 @@ ThreadPool::_add_thread_scaling_locked(const std::string &name_) _name.c_str(), rv, strerror(rv)); + + // Treat creation failure as a scaling event so the cooldown + // timer suppresses immediate retries from the monitor and + // fast-path pressure grow, avoiding syslog spam under + // sustained resource pressure. + if(_autoscale_enabled) + _last_scale_time_usecs.store(_now_usecs(),std::memory_order_relaxed); + return -rv; }