Repository navigation
fix(cpdaemon): read worker memory settings from cpm.worker.memory - #303
Merged
Merged
Conversation
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.
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.
Summary
cpdaemon read the worker memory settings from
cpm.worker.memory_policy.*, but the example configand the documentation use
cpm.worker.memory.*. Settings written as documented were ignored, andcpdaemon 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 tocpm.worker.control.unix.path; it is updated, and now showspid_file,control.typeandmemory.default_limit_mb.Upgrade notes
cpm.worker.memory.*now takes effect. A deployment that set these keys to non-default valueswas running with the defaults; after the upgrade it runs with the configured values.
cpm.worker.memory_policy.*(andCPDAEMON_CPM_WORKER_MEMORY_POLICY_*environment variables)is no longer read. Rename it to
cpm.worker.memory.*.Tests
TestExampleConfigKeysAreRead: every key inexamples/*.jsonandcmd/testdata/config.jsonis a key cpdaemon reads.
Test_Viper: the memory sizes are read from the config file.Fixes #266