Skip to content

feat: report busy jobs by default - #282

Merged
adamlogic merged 2 commits into
mainfrom
adam/jdo-1616-busy-on-by-default
Nov 17, 2026
Merged

adamlogic merged 2 commits into
mainfrom
adam/jdo-1616-busy-on-by-default

Conversation

@adamlogic

@adamlogic adamlogic commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Refs JDO-1616.

Change

track_busy_jobs now defaults to true for every job adapter that supports it: Sidekiq, Solid Queue, Resque, Delayed Job, GoodJob, and Que. Shoryuken doesn't support busy jobs and stays off.

Apps can opt out per adapter:

Judoscale.configure do |config|
  config.sidekiq.track_busy_jobs = false
end

The deprecated JUDOSCALE_LONG_JOBS / RAILS_AUTOSCALE_LONG_JOBS env vars still work: false turns it off for all adapters and true turns it on, as before. The README now points only to track_busy_jobs = false.

The sample apps no longer opt in explicitly.

Reporting busy jobs doesn't change autoscaling on its own. "Prevent downscaling when jobs are busy" remains a separate setting in the Judoscale dashboard. This builds on #280, which removed the extra queries busy tracking made in Delayed Job, GoodJob, and Resque.

Tests

  • Config and adapter tests now expect busy tracking on by default, plus a test that JUDOSCALE_LONG_JOBS=false turns it off. These fail on the previous default.
  • Metrics collector tests that cover queue time and depth turn busy tracking off explicitly; the busy job tests turn it on as before.
  • All adapter suites pass locally, and standardrb is clean.

Refs JDO-1616.

`track_busy_jobs` now defaults to true for every job adapter that supports
it (all except Shoryuken). Apps can opt out with
`config.<adapter>.track_busy_jobs = false` or `JUDOSCALE_LONG_JOBS=false`.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1e468-998c-74b8-b0c9-3ec140fd2566
Co-authored-by: Adam McCrea <adam@adamlogic.com>
Busy tracking is on by default now. Point the README only at
track_busy_jobs = false for opting out.

Refs JDO-1616

Amp-Thread-ID: https://ampcode.com/threads/T-01a1e468-998c-74b8-b0c9-3ec140fd2566
Co-authored-by: Adam McCrea <adam@adamlogic.com>
@adamlogic
adamlogic merged commit 0246175 into main Nov 17, 2026
123 checks passed
@adamlogic
adamlogic deleted the adam/jdo-1616-busy-on-by-default branch November 17, 2026 19:42
adamlogic added a commit to judoscale/judoscale-python that referenced this pull request Nov 17, 2026
Turns on busy job tracking (`TRACK_BUSY_JOBS`) by default for RQ and
Celery, matching the Ruby adapters
([judoscale-ruby#282](judoscale/judoscale-ruby#282)).
Set `TRACK_BUSY_JOBS` to `False` to opt out.

- **RQ:** counts busy jobs with a read-only `ZCOUNT` of unexpired
entries in the started job registry. `StartedJobRegistry.count` runs the
registry cleanup first, which writes to Redis on every collection.
- **Celery:** reads the workers' control queue bindings from Redis and
passes them to `inspect()` as the destination, so `active()` returns
once those workers reply instead of always waiting out its 1 s timeout.
If no worker replies (for example, remote control is disabled), busy
jobs are unknown, so no busy metrics are reported rather than 0.
- **Celery:** if `inspect().active()` fails, that cycle skips the busy
metric instead of failing the whole collection, so queue time and depth
are still reported.

Refs JDO-1616

---------

Co-authored-by: Amp <amp@ampcode.com>
adamlogic pushed a commit that referenced this pull request Nov 17, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.15.0](v1.14.0...v1.15.0)
(2026-11-17)


### Features

* report busy jobs by default
([#282](#282))
([0246175](0246175))


### Performance Improvements

* collect busy jobs without extra queries in Delayed Job, GoodJob, and
Resque ([#280](#280))
([057418e](057418e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants