Skip to content

refactor(server): honor cgroup reclaim protection - #3325

Merged
imbajin merged 4 commits into
apache:masterfrom
hugegraph:fix/server-cgroup-reclaim-protection
Oct 13, 2026
Merged

imbajin merged 4 commits into
apache:masterfrom
hugegraph:fix/server-cgroup-reclaim-protection

Conversation

@imbajin

@imbajin imbajin commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Parent cgroup cache could be counted as reclaimable even when sibling memory.min protects it. Exclude that credit when protection is active or cannot be established. Finite limits with unknown usage provide no heap budget; recognized v1 unlimited sentinels retain the existing host fallback.

Validated with shell regressions, bounded Linux kernel reclaim controls and the Java 17 reactor build. Three independent final reviews passed. The same source branch passed the selected checks in org #299, including the Store retry and required reporter.

The repository runtime guide is updated; website deployment guidance is paired with Docs #517. Full Server, warm-cache pressure and container/OOM acceptance remain tracked in the 1.8.0 validation documents.

Implementation overview

Conceptual startup memory-budget flow; not runtime/OOM evidence.

Implementation overview

V1 unlimited limits use recognized kernel machine names; unknown or masked names retain the finite-limit path, including 32-bit userspace on a 64-bit kernel.

- exclude cache protected by child memory.min
- reject finite limits with unknown memory usage
- preserve ordinary warm-cache and v1 behavior
- cover permission failures and document conservative sizing
- derive the v1 sentinel from native word and page sizes
- continue checking finite ancestors of unlimited cgroups
- retain host sizing when no finite cgroup limit exists
- verify unknown-usage and sentinel boundaries
@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.58%. Comparing base (68fb045) to head (d71b4d5).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3325      +/-   ##
============================================
- Coverage     52.63%   52.58%   -0.05%     
+ Complexity     2435     2370      -65     
============================================
  Files           770      762       -8     
  Lines         67694    67674      -20     
  Branches       9172     9189      +17     
============================================
- Hits          35631    35587      -44     
- Misses        28520    28536      +16     
- Partials       3543     3551       +8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@imbajin imbajin left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Cross-checked against fork #299: this PR has the same head, base and three-file patch reviewed independently by two reviewers. Source-review score: 8.5/10; no new blocking defect found. Unknown usage under a finite limit fails conservatively; v1 unlimited levels are skipped before reading usage; v2 child protection can remove cache credit. The extra enumeration is confined to startup, not query hot paths. Remaining validation: non-root permission cases and real cgroup warm/cold pressure/OOM behavior. Dropping all cache credit for protected/unknown children is intentionally conservative and may reject otherwise viable warm starts. Fork CI is separate from this upstream PR’s current checks; this is not full 1.8.0 acceptance.

@imbajin imbajin left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Blocking: no. Summary: One non-blocking cgroup v1 edge case remains in the userspace word-size assumption. Evidence: util.sh uses getconf LONG_BIT; latest-head checks show no blocking failures, while codecov/project is non-blocking.

Comment thread hugegraph-server/hugegraph-dist/src/assembly/static/bin/util.sh Outdated
- infer v1 unlimited limits from known kernel machines
- preserve finite limits on unknown or masked machines
- cover compatibility metadata and missing usage
Comment thread docs/server-runtime.md Outdated
- describe kernel architecture and page-size recognition
- preserve finite limits for unknown architectures
- keep runtime and deployment verification boundaries
@imbajin imbajin changed the title fix(server): honor cgroup reclaim protection refactor(server): honor cgroup reclaim protection Oct 13, 2026
@imbajin
imbajin merged commit b73c13c into apache:master Oct 13, 2026
34 of 35 checks passed
@imbajin
imbajin deleted the fix/server-cgroup-reclaim-protection branch October 13, 2026 07:00
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.

2 participants