Visitar URL original
fix(database): add cgroup v2 compatibility for container memory check in GDD and RAC 21.3.0 by reginaldalfret · Pull Request #3141 · oracle/docker-images · GitHub
Skip to content

fix(database): add cgroup v2 compatibility for container memory check in GDD and RAC 21.3.0 - #3141

Open
reginaldalfret wants to merge 1 commit into
oracle:mainfrom
reginaldalfret:fix/cgroup-v2-memory-check
Open

reginaldalfret wants to merge 1 commit into
oracle:mainfrom
reginaldalfret:fix/cgroup-v2-memory-check

Conversation

@reginaldalfret

Copy link
Copy Markdown

Problem

In \OracleDatabase/GDD/containerfiles/scripts/runOraShardSetup.sh\ and \OracleDatabase/RAC/OracleRealApplicationClusters/dockerfiles/21.3.0/runOracle.sh, the container memory check reads the cgroup v1 path /sys/fs/cgroup/memory/memory.limit_in_bytes. Under cgroup v2 (the default on modern Linux, Docker, and Podman systems), this path does not exist, causing \cat\ to fail with \No such file or directory\ and rendering the memory check inert.

Solution

Update both scripts to adopt the cgroup v2 compatibility pattern already used across the other SingleInstance and RAC
unOracle.sh\ scripts:

  1. Check whether /sys/fs/cgroup/cgroup.controllers\ exists. If so, read /sys/fs/cgroup/memory.max; otherwise read /sys/fs/cgroup/memory/memory.limit_in_bytes.
  2. Guard against \max\ (when no memory limit is specified on the container) and verify integer bounds before enforcing the minimum threshold.

… in GDD and RAC 21.3.0

Under cgroup v2 (default on modern container hosts),
/sys/fs/cgroup/memory/memory.limit_in_bytes does not exist, causing
cat to fail with 'No such file or directory' and rendering the memory
check inert.

Adopt the cgroup v2 check pattern used across the other SingleInstance
and RAC scripts by reading /sys/fs/cgroup/memory.max when
/sys/fs/cgroup/cgroup.controllers exists.

Signed-off-by: reginaldalfret <reginaldalfret@gmail.com>
@oracle-contributor-agreement

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant