Fix oom-score-adj-values range, abs options, and bug when used in config file#8046
Fix oom-score-adj-values range, abs options, and bug when used in config file#8046oranagra merged 2 commits intoredis:unstablefrom oranagra:fix_oom_adj_values
Conversation
When oom-score-adj-values is provided in the config file after oom-score-adj yes, it'll take an immediate action, before readOOMScoreAdj was acquired, resulting in an error (out of range score due to uninitialized value. delay the reaction the real call is made by main(). since the values are clamped by the OS to -1000..1000, and they're applied as an offset from the value at startup (which may be -1000), we need to allow the offsets to reach to +2000 so that a value of +1000 is achievable in case the value at startup was -1000.
|
@oranagra It makes sense but it may not be intuitive. Do you think it may perhaps make more sense to make it possible to indicate absolute vs relative values? |
|
@yossigo you mean a 3rd config that controls absolute vs relative? |
|
@oranagra Why do you think it's necessary if there's a way to set absolute values? |
|
@yossigo first, there'a a bugfix in this PR (not to call secondly, if you do allow a relative offset (both positive and negative offset), it's range should be large enough to cover the entire range. |
|
@yossigo please have a look at the second commit. |
|
@redis/core-team sorry, i just realized a merged a change to the config options without a consensus. |
|
No objections, but adding the 'release notes' label so we don't forget to mention it for upgraders. |
…fig file (#8046) Fix: When oom-score-adj-values is provided in the config file after oom-score-adj yes, it'll take an immediate action, before readOOMScoreAdj was acquired, resulting in an error (out of range score due to uninitialized value. delay the reaction the real call is made by main(). Since the values are clamped to -1000..1000, and they're applied as an offset from the value at startup (which may be -1000), we need to allow the offsets to reach to +2000 so that a value of +1000 is achievable in case the value at startup was -1000. Adding an option for absolute values rather than relative ones. (cherry picked from commit 6195495)
…fig file (redis#8046) Fix: When oom-score-adj-values is provided in the config file after oom-score-adj yes, it'll take an immediate action, before readOOMScoreAdj was acquired, resulting in an error (out of range score due to uninitialized value. delay the reaction the real call is made by main(). Since the values are clamped to -1000..1000, and they're applied as an offset from the value at startup (which may be -1000), we need to allow the offsets to reach to +2000 so that a value of +1000 is achievable in case the value at startup was -1000. Adding an option for absolute values rather than relative ones.
When oom-score-adj-values is provided in the config file after
oom-score-adj yes, it'll take an immediate action, before
readOOMScoreAdj was acquired, resulting in an error (out of range score
due to uninitialized value. delay the reaction the real call is made by
main().
since the values are clamped to -1000..1000, and they're
applied as an offset from the value at startup (which may be -1000), we
need to allow the offsets to reach to +2000 so that a value of +1000 is
achievable in case the value at startup was -1000.