Defend against systems with no memory.max#1605
Merged
lognaturel merged 2 commits intogetodk:nextfrom Jan 27, 2026
Merged
Conversation
4f8a91c to
29ddf6c
Compare
Contributor
|
Looks like there's more context at: |
63a2f19 to
aaea320
Compare
ed6f60f to
ff187c2
Compare
alxndrsn
reviewed
Jan 14, 2026
files/service/scripts/start-odk.sh
Outdated
| local cgroup_version | ||
| local cgroup_version memtot fallback_memtot | ||
| cgroup_version=$(get_cgroup_version) | ||
| fallback_memtot=$(grep MemTotal /proc/meminfo | awk '{print $2 * 1024}') |
Contributor
There was a problem hiding this comment.
What happens if /proc/meminfo is unreadable?
Member
Author
There was a problem hiding this comment.
Updated to set fallback to 0 in that case.
alxndrsn
reviewed
Jan 14, 2026
| fi | ||
| } | ||
|
|
||
| MEMTOT=$(get_memory_limit) |
Contributor
There was a problem hiding this comment.
Would this be safer?
Suggested change
| MEMTOT=$(get_memory_limit || echo "unknown") |
This should do something like:
...
grep: /proc/meminfo: Permission denied
using 1 worker(s) based on available memory (0)..
Contributor
There was a problem hiding this comment.
If looking for the most narrow change possible I suspect this is it.
Member
Author
There was a problem hiding this comment.
I've now also simplified cgroup detection.
c36d8db to
8bc1880
Compare
8bc1880 to
2973b12
Compare
lognaturel
approved these changes
Jan 27, 2026
Member
lognaturel
left a comment
There was a problem hiding this comment.
Reasoned through it and tested on dev.
This was referenced Jan 27, 2026
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.
Fixes #1603
Fixes #1181
Tried to make the most narrow change possible: check for the necessary file and fall back to using all memory if the file is missing.