• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cjrh / deadpool / 46766534867
89%

Build:
DEFAULT BRANCH: main
Ran 01 Dec 2026 11:08PM UTC
Jobs 1
Files 13
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Dec 2026 11:06PM UTC coverage: 88.57% (+0.2%) from 88.414%
46766534867

push

github

web-flow
Add refresh_idle_workers: replace a used worker the pool keeps when idle (#457)

Adds `refresh_idle_workers` to `Deadpool`, off by default, as discussed
on #452. #456 gives an available warm worker priority. If none is
available, the next task can wait for the replacement’s initializer to
finish.

A worker that the pool keeps at `min_workers` holds whatever memory its
last tasks left behind, until its next task or for good. With the
option, a kept worker that has run a task and then been idle for
`idle_timeout` is replaced by a new one.

**Behaviour, with `min_workers`, `idle_timeout` and
`refresh_idle_workers=True`:**

- The pool shrinks first. It refreshes only when nothing can be stopped
and no worker is being returned, because with that one back it may be
able to shrink instead.
- The longest-idle expired worker that has run a task is replaced. A
task counts once its result message arrives, also if that cannot be
loaded. One that has run nothing is left alone, so a quiet pool does not
keep replacing workers.
- The new worker starts before the old one is told to stop. If it cannot
start, the old one stays, the failure is counted in `idle_sweep_errors`
and logged, and the timer tries again, also if logging it fails.
- The start and the claim are one step under `_checkout_lock`, so a task
cannot be given the worker being replaced. A waiting direct checkout
takes a worker without that lock, so nothing is refreshed while there is
one.
- One worker stops at a time. A replaced worker counts in
`worker_processes_stopped_idle`.

**What it costs:**

- The pool is one process above its count from the start of the new
worker until the old one exits, also when it is at `max_workers`. On a
machine near its memory limit, allow for one more worker.
- A task that arrives while the new worker is being started waits for
that process start, as it does when a task starts one.
- Each new worker pays again for anything its next task loads or caches
on first use, which i... (continued)

807 of 997 branches covered (80.94%)

Branch coverage included in aggregate %.

61 of 61 new or added lines in 1 file covered. (100.0%)

2773 of 3045 relevant lines covered (91.07%)

5.44 hits per line

Jobs
ID Job ID Ran Files Coverage
1 46766534867.1 01 Dec 2026 11:09PM UTC 13
88.57
GitHub Action Run
Source Files on build 46766534867
  • Tree
  • List 13
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 49f788c9 on github
  • Prev Build on main (#46490229994)
  • Next Build on main (#46770245704)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc