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

cjrh / deadpool / 46885990781
89%

Build:
DEFAULT BRANCH: main
Ran 02 Dec 2026 12:58PM 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

02 Dec 2026 12:55PM UTC coverage: 89.109% (+0.1%) from 88.984%
46885990781

push

github

web-flow
Wait for a worker being returned rather than start one (#460)

With `idle_timeout` set, a task that finds no idle worker while another
worker is still being given back starts a new one. The returning worker
is back moments later, so the new one is not needed: it sits idle until
the timer stops it, and its start costs a process start and its
initializer.

The window is in `done_with_process`: the worker has left `busy_workers`
but is not yet idle while the pool checks it (its task count and, with
`max_worker_memory_bytes`, its memory). `get_process` sees neither busy
nor idle workers there, and the pool below `max_workers`, so it starts
one.

**Measured on 2026.11.3**, `max_workers=3`, `min_workers=1`,
`idle_timeout=3`: after a quiet spell, one task, then two back to back.
With `max_worker_memory_bytes`, a worker was started in 7 of 8 spells;
without it, in 0 of 8; a pool without a minimum, in 0 of 8. The second
task did not have to wait in any of them. With this change (`ee064aa`),
the same script started none in 8 of 8 with the memory limit, and none
in the other two cases.

**Change:** `get_process` reads `_returning` (from #457) with the busy
count. With the idle timer on, a task that finds no idle worker can wait
for an unclaimed worker that is being given back (one more returning
worker than checkouts already waiting). It waits on a condition that is
notified when a return finishes, when a worker is added and when
shutdown starts, then checks again. While the pool has room to grow, it
waits at most 250 ms in all (`_WORKER_REUSE_GRACE`, private), so a slow
return, such as a logging handler that blocks, cannot hold up a task
that could start a worker of its own. Returning workers count against
`max_workers`, and at capacity a task waits for a worker as before. A
return can finish without leaving a worker available (the memory check
raised, or another task took the worker first), so the task never waits
on the idle queue itself. Without the timer, n... (continued)

870 of 1061 branches covered (82.0%)

Branch coverage included in aggregate %.

80 of 82 new or added lines in 1 file covered. (97.56%)

2 existing lines in 1 file now uncovered.

2951 of 3227 relevant lines covered (91.45%)

5.47 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
96.09
0.31% deadpool/_pool.py

Coverage Regressions

Lines Coverage ∆ File
2
83.02
-0.24% deadpool/remote/server.py
Jobs
ID Job ID Ran Files Coverage
1 46885990781.1 02 Dec 2026 12:59PM UTC 13
89.11
GitHub Action Run
Source Files on build 46885990781
  • Tree
  • List 13
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 371425af on github
  • Prev Build on main (#46770456944)
  • Next Build on main (#46886186653)
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