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

cjrh / deadpool / 46770245704
89%

Build:
DEFAULT BRANCH: main
Ran 01 Dec 2026 11:32PM 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:29PM UTC coverage: 88.913% (+0.3%) from 88.57%
46770245704

push

github

web-flow
Add worker_stop_timeout: kill a worker that takes too long to stop (#458)

Proposes `worker_stop_timeout`, off by default: a worker that is still
alive that many seconds after the pool told it to stop is killed, with
the processes it started. This is the stop deadline from the discussion
on #452, as its own PR. Is this the shape you had in mind?

A worker whose finalizer is stuck never goes away. Since #454 it also
holds up the idle timer, which stops no other worker until that one
exits, and a `shutdown(wait=True)` that joins the timer.

**Scope,** following your notes on #452:

- **Every worker the pool stops while it is running:** idle expiry,
shrinking to `min_workers`, task count, memory, and `clear_workers`.
- **The deadline starts** once the worker has been told to stop.
- **It can interrupt a finalizer.** The docstring and the README say so,
and say to choose a limit well above the longest a finalizer should
take.
- **`shutdown` is separate:** it puts no limit on the workers it stops
itself, whose finalizers run to their end as now. One that was already
stopping keeps its limit, so `shutdown(wait=True)` waits no longer than
that for an idle worker that was being stopped.

**How:** the idle timer limits the stop it waits for. The stops that
nothing waits for (recycling, shrinking, `clear_workers`) go to one
daemon thread, which starts before the workers and sleeps until the
earliest deadline. It holds only deadlines and process identities, so
recycling does not hold on to file descriptors. The identity is taken
when the worker starts, so a reused pid is neither searched for children
nor signalled. A kill that fails, or that the process survives, is tried
again after another timeout.

- **Shutdown:** with the option on, a call that may retire a worker is
counted, under the watcher's lock, from before the worker leaves the
pool. The watcher ends when the pool is closed, no such call is running
and no worker is still stopping. Once the pool is clo... (continued)

847 of 1039 branches covered (81.52%)

Branch coverage included in aggregate %.

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

3 existing lines in 2 files now uncovered.

2898 of 3173 relevant lines covered (91.33%)

5.47 hits per line

Coverage Regressions

Lines Coverage ∆ File
2
83.02
-0.24% deadpool/remote/server.py
1
95.79
0.64% deadpool/_pool.py
Jobs
ID Job ID Ran Files Coverage
1 46770245704.1 01 Dec 2026 11:34PM UTC 13
88.91
GitHub Action Run
Source Files on build 46770245704
  • 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
  • 5b544790 on github
  • Prev Build on main (#46766534867)
  • Next Build on main (#46770456944)
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