Skip to content

Conversation

@yanokwa
Copy link
Member

@yanokwa yanokwa commented Jan 13, 2026

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.

@alxndrsn
Copy link
Contributor

Looks like there's more context at:

@yanokwa yanokwa force-pushed the fix-start-script branch 3 times, most recently from 63a2f19 to aaea320 Compare January 13, 2026 20:30
@matthew-white matthew-white changed the base branch from master to next January 13, 2026 23:30
local cgroup_version
local cgroup_version memtot fallback_memtot
cgroup_version=$(get_cgroup_version)
fallback_memtot=$(grep MemTotal /proc/meminfo | awk '{print $2 * 1024}')
Copy link
Contributor

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?

Copy link
Member Author

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)..

Copy link
Contributor

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.

Copy link
Member Author

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.

@yanokwa yanokwa force-pushed the fix-start-script branch 2 times, most recently from c36d8db to 8bc1880 Compare January 14, 2026 17:48
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.

start-odk.sh fails if /sys/fs/cgroup/memory/memory.limit_in_bytes is missing If /sys/fs/cgroup/memory.max doesn’t exist, Central crashes.

2 participants