config: load queue settings for workers
Summary
Workers currently omit SectionQueues from their service-scoped configuration. As a result, a distributed run using dag.enqueue can fail with queues are disabled in configuration even when queues are enabled (including by default).
Changes
- Load
SectionQueuesforServiceWorker. - Update the service comment and add regression coverage for default, explicitly enabled, and explicitly disabled queues, including a named queue with
max_concurrency: 2.
For example, with the following configuration, a worker previously saw Queues.Enabled == false and no named queue settings; after the fix it sees true and the configured queue limit of 2:
queues:
enabled: true
config:
- name: batch
max_concurrency: 2
Core change
internal/cmn/config/loader.go:154 adds the queue section to the worker's existing service requirements:
- ServiceWorker: SectionWorker | SectionCoordinator | SectionProc,
+ ServiceWorker: SectionWorker | SectionCoordinator | SectionProc | SectionQueues,
The existing queue loader then runs for workers, as it already does for other execution services. The dag.enqueue executor's existing enabled check can therefore use the actual worker configuration.
Testing
Tested on upstream main at 6a72fdbe41bea54e6fa076092c16ce4d236c2dd4, Go 1.27.4, darwin/arm64.
Independent reproduction: apply only the internal/cmn/config/loader_test.go portion of this PR, then run:
go test ./internal/cmn/config -run '^TestLoad_WorkerQueueConfig$' -count=1 -v
- Before the fix: exit 1; all three subtests failed. Default and explicitly enabled queues were false, and named queue configuration was nil.
- After applying the loader change: exit 0; all three subtests passed.
go test ./internal/cmn/config -count=1: PASS (2.318s).go test -race ./internal/cmn/config -count=1: PASS (10.348s).gofmtandgit diff --check: clean for both changed files.
The regression tests the service-scoped loader directly; a full distributed end-to-end run was not performed. The package tests were run directly instead of through the make test wrapper, which also builds the entire binary. Repository-wide make fmt was not run.
Related Issues
Related changes: #1467 (service-scoped configuration) and #2163 (dag.enqueue). No matching open issue or duplicate PR was found in the targeted search.
Performance
No material performance risk: the worker loads the existing queue configuration at startup; no new polling, per-run work, messages, or persisted data are introduced.
Compatibility
No new configuration keys or wire-format changes. Existing queue settings, including explicitly disabled queues, retain their meaning. This change does not alter the coordinator/worker protocol or the persisted state format; mixed-version execution was not tested.
Checklist
- Code follows the project style guidelines
- Self-review of the code has been performed
- Tests have been added or updated as needed
- Documentation has been updated as needed (service comment)
- Changes have been tested locally
Summary by cubic
Fixes worker queue configuration loading so dag.enqueue works in distributed runs.
Workers previously omitted SectionQueues from their service-scoped configuration, causing dag.enqueue to fail with "queues are disabled in configuration" even when queues were enabled (including by default). The loader now includes the queues section for workers, and regression tests cover default, explicitly enabled, and explicitly disabled queues, including a named queue with max_concurrency: 2.
Summary by CodeRabbit
- Configuration
- Worker configurations now load queue settings, including whether queues are enabled and their configured limits. Queues are enabled by default.