Return all workers from scheduler_info() by default#9308
Open
mrocklin wants to merge 1 commit into
Open
Conversation
`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>
Contributor
Unit Test ResultsSee 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 For more details on these failures, see this check. Results for commit 9caa747. ± Comparison against base commit 3b0ba32. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Client.scheduler_info()defaulted ton_workers=5, silently truncating the "workers" dict to the first five workers. This was misleading and, more importantly, brokerestart_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 ton_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_workersnow fetches a fresh, full identity viascheduler.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