-
Notifications
You must be signed in to change notification settings - Fork 213
Defend against systems with no memory.max #1605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
4f8a91c to
29ddf6c
Compare
|
Looks like there's more context at: |
63a2f19 to
aaea320
Compare
ed6f60f to
ff187c2
Compare
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}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if /proc/meminfo is unreadable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to set fallback to 0 in that case.
| fi | ||
| } | ||
|
|
||
| MEMTOT=$(get_memory_limit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this be safer?
| 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)..There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If looking for the most narrow change possible I suspect this is it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've now also simplified cgroup detection.
c36d8db to
8bc1880
Compare
8bc1880 to
2973b12
Compare
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.