Skip to content

fix(cpdaemon): read worker memory settings from cpm.worker.memory - #303

Merged
timmy21 merged 1 commit into
0.9.xfrom
fix/266-cpdaemon-config-keys
Oct 8, 2026
Merged

timmy21 merged 1 commit into
0.9.xfrom
fix/266-cpdaemon-config-keys

Conversation

@timmy21

@timmy21 timmy21 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Summary

cpdaemon read the worker memory settings from cpm.worker.memory_policy.*, but the example config
and the documentation use cpm.worker.memory.*. Settings written as documented were ignored, and
cpdaemon ran with the defaults. This changes the key to cpm.worker.memory.

The example config also still used cpm.worker.unix_socket, which was renamed to
cpm.worker.control.unix.path; it is updated, and now shows pid_file, control.type and
memory.default_limit_mb.

Upgrade notes

  • cpm.worker.memory.* now takes effect. A deployment that set these keys to non-default values
    was running with the defaults; after the upgrade it runs with the configured values.
  • cpm.worker.memory_policy.* (and CPDAEMON_CPM_WORKER_MEMORY_POLICY_* environment variables)
    is no longer read. Rename it to cpm.worker.memory.*.

Tests

  • TestExampleConfigKeysAreRead: every key in examples/*.json and cmd/testdata/config.json
    is a key cpdaemon reads.
  • Test_Viper: the memory sizes are read from the config file.

Fixes #266

The memory settings were read from cpm.worker.memory_policy.*, while the
example config and the documentation use cpm.worker.memory.*. Settings
written as documented had no effect, and cpdaemon used the defaults.
memory_policy is not accepted any more.

examples/template.json and cmd/testdata/config.json still used
cpm.worker.unix_socket, which became cpm.worker.control.unix.path.
The template now also shows pid_file, control.type and
memory.default_limit_mb.

TestExampleConfigKeysAreRead checks that every key in the example
configs is one cpdaemon reads.
@timmy21
timmy21 merged commit ecbdb85 into 0.9.x Oct 8, 2026
1 check passed
@timmy21
timmy21 deleted the fix/266-cpdaemon-config-keys branch October 8, 2026 02:09
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.

cpdaemon: examples/template.json documents cpdaemon keys that are never read

1 participant