mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
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) <noreply@anthropic.com>
This commit is contained in:
parent
1dd979f955
commit
02703ef239
1 changed files with 8 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue