Skip to content

Return all workers from scheduler_info() by default#9308

Open
mrocklin wants to merge 1 commit into
dask:mainfrom
mrocklin:claude/cranky-shirley-0445ad
Open

Return all workers from scheduler_info() by default#9308
mrocklin wants to merge 1 commit into
dask:mainfrom
mrocklin:claude/cranky-shirley-0445ad

Conversation

@mrocklin

Copy link
Copy Markdown
Member

Client.scheduler_info() defaulted to n_workers=5, silently truncating the "workers" dict to the first five workers. This was misleading and, more importantly, broke restart_workers: both the nanny-required validation and the worker name -> address resolution read this truncated set, so on clusters with more than five workers the nanny check was silently skipped and name-based restarts of later workers misfired.

Changes:

  • scheduler_info() now defaults to n_workers=-1 (all workers). This only affects explicit, on-demand calls, not the periodic per-client poll, so the scheduler-scalability fix from Reduce size of scheduler_info #9045 / Scheduler not robust to many connected clients #9043 is not reintroduced (the periodic cache populator stays capped at 5).
  • _restart_workers now fetches a fresh, full identity via scheduler.identity(n_workers=-1) and performs both the nanny check and the name resolution there, correct for any cluster size. This also collapses the previous two identity RPCs on the sync path into one.

Adds a regression test that restarts a non-nanny worker beyond the historical five-worker cap; it raises the expected error only with the fix.

xref #9065

`Client.scheduler_info()` defaulted to `n_workers=5`, silently truncating
the "workers" dict to the first five workers. This was misleading and, more
importantly, broke `restart_workers`: both the nanny-required validation and
the worker name -> address resolution read this truncated set, so on clusters
with more than five workers the nanny check was silently skipped and
name-based restarts of later workers misfired.

Changes:
- `scheduler_info()` now defaults to `n_workers=-1` (all workers). This only
  affects explicit, on-demand calls, not the periodic per-client poll, so the
  scheduler-scalability fix from dask#9045 / dask#9043 is not reintroduced (the
  periodic cache populator stays capped at 5).
- `_restart_workers` now fetches a fresh, full identity via
  `scheduler.identity(n_workers=-1)` and performs both the nanny check and the
  name resolution there, correct for any cluster size. This also collapses the
  previous two identity RPCs on the sync path into one.
- Document the sync/async asymmetry: async clients read the periodically
  cached value, so `n_workers` is only honored for synchronous clients.

Adds a regression test that restarts a non-nanny worker beyond the historical
five-worker cap; it raises the expected error only with the fix.

xref dask#9065

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mrocklin mrocklin requested a review from fjetter as a code owner June 26, 2026 21:49
@github-actions

Copy link
Copy Markdown
Contributor

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

    40 files  ± 0      40 suites  ±0   14h 24m 21s ⏱️ - 12m 53s
 4 154 tests + 1   3 973 ✅ ± 0    178 💤 ±0  3 ❌ +1 
80 840 runs  +19  76 600 ✅ +19  4 237 💤  - 1  3 ❌ +1 

For more details on these failures, see this check.

Results for commit 9caa747. ± Comparison against base commit 3b0ba32.

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.

1 participant