Repository navigation
Conversation
Contributor
sadpandajoe
requested review from
hainenber,
michael-s-molina,
mistercrunch and
villebro
November 19, 2026 18:18
hainenber
reviewed
Nov 21, 2026
| usage_bytes="${current_value}" | ||
| fi | ||
| fi | ||
| elif [[ -f "${CGROUP_PATH}/memory.limit_in_bytes" ]]; then |
Contributor
There was a problem hiding this comment.
No need to continue supporting cgroup v1, you can simplify the implementation code and below test
Contributor
Author
There was a problem hiding this comment.
Thanks for the suggestion — done. I removed the cgroup v1 branch from container_mem_avail_kb so it only reads memory.max / memory.current, and simplified the test: the two v1 cases are gone, replaced by one case proving a v1-only container now falls back to the host value. The test suite passes (6/6), including the new case failing on the previous version.
Per review feedback on apache#46373, only cgroups v2 is supported now: the memory.limit_in_bytes / memory.usage_in_bytes branch is removed and container_mem_avail_kb reads memory.max / memory.current only. The regression test drops the two v1 cases and gains one proving a v1-only container now falls back to the host value.
hainenber
approved these changes
Nov 22, 2026
hainenber
left a comment
Contributor
There was a problem hiding this comment.
Lgtm. Thank you for your contribution 👍
jprinet
added a commit
to jprinet/superset
that referenced
this pull request
Nov 23, 2026
* origin/master: (393 commits) fix(a11y): name the semantic view description input (apache#46458) docs(semantic): explain datasource list modification eligibility (apache#46462) docs(semantic-layer): document NULL-preserving exclusion filters (apache#46447) fix(uploads): skip folder and system entries in columnar ZIP uploads (apache#45617) fix(i18n-es): promote 47 of the zero-context backfill entries (apache#45847) fix(mcp): return structured ChartError on SQLAlchemyError in get_chart_sql (apache#44351) fix(datasets): follow semantic view modification permissions (apache#46448) fix(docker): account for container memory limits in frontend-mem-nag.sh (apache#46373) fix(reports): carry the report's native filters in the email and Slack link (apache#46062) fix(explore): apply the dataset timezone to grained temporal filter values (apache#46175) fix(i18n): enforce the do-not-translate registry across the catalogs (apache#45974) chore(logging): log unparseable virtual dataset SQL at debug in the RLS lookup (apache#46139) fix(i18n): split parameter-suggestion plural into two messages (apache#46049) test(partition-mapping): cover Hive/Impala mirrored SQL, cache outage and migration (apache#46319) perf(dashboard): look up the dashboard once per filter_state read (apache#46314) fix(i18n): load the dayjs locale for every language with a catalog (apache#45982) test(semantic-layer): make date export parametrization deterministic (apache#46449) fix(oauth2): idempotent OAuth2 completion and resilient listener (apache#40292) fix(explore): prevent full table scan when SQL expression is used as x-axis (apache#41339) feat(mcp): radar chart type plugin (apache#43571) ... # Conflicts: # .github/workflows/docker.yml # .github/workflows/superset-frontend.yml
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.
SUMMARY
docker/frontend-mem-nag.sh(run at image build time,Dockerfile:77) reads only/proc/meminfo, which reports host memory inside a container. When the host has more than 3 GB available but the container is limited below 3 GB, the script reports sufficient memory and omits the warning, leaving developers unaware the frontend build is running with less memory than the stated minimum.This change makes the script account for the container memory limit: it reads the cgroup limit and usage (cgroups v2
memory.max/memory.current, cgroups v1memory.limit_in_bytes/memory.usage_in_bytes) and warns on the lower of the host's available memory and the container's remaining memory. A "max" (v2) or 2^63 (v1) limit is treated as unlimited, and when no finite limit applies the script falls back to host memory, so behaviour outside containers is unchanged.Also included:
MEMINFO_PATH/CGROUP_PATHoverrides (defaulting to the live paths) so the script can be tested without a container.docker/frontend-mem-nag.test.sh, covering v1/v2 limits, unlimited limits, no cgroup files, and theMemFreefallback.${MEM_TYPE}variable (it rendered as nothing).Fixes #46368
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable (shell script, no UI). Before/after output, reproduced in a mount namespace with fake MemAvailable 8 GiB and a cgroup v2 limit of 1 GiB (0.2 GiB used):
Before:
After:
TESTING INSTRUCTIONS
bash docker/frontend-mem-nag.test.sh— all 7 regression cases pass.meminfowithMemAvailable: 8000000 kBover/proc/meminfoand a cgroup dir withmemory.max= 1073741824 andmemory.current= 209715200 over/sys/fs/cgroup, then rundocker/frontend-mem-nag.sh. Before this change it printsMemory available: 7.62939 GB; after, it shows the warning with 0.804688 GB.pre-commit runon the changed files passes;bash -nis clean on both files.ADDITIONAL INFORMATION
cc @shubhamjrd4559-sudo