Skip to content

fix(positions): use deterministic temp file to prevent dentry slab growth - #7043

Open
AruneshDwivedi wants to merge 1 commit into
grafana:mainfrom
AruneshDwivedi:fix/positions-dentry-slab
Open

AruneshDwivedi wants to merge 1 commit into
grafana:mainfrom
AruneshDwivedi:fix/positions-dentry-slab

Conversation

@AruneshDwivedi

Copy link
Copy Markdown

Summary

Replaces renameio.WriteFile with a custom atomicWriteFile that uses a deterministic temp path (.tmp) instead of a unique random name on every call. This prevents unbounded kernel dentry slab growth under cgroup v2 when positions are written every 10 seconds.

Changes

  • : Replaced renameio.WriteFile with atomicWriteFile using deterministic temp path
  • : Added TestWritePositionFile_ReusesDentry test

Fixes #6938

…owth

Replaces renameio.WriteFile with a custom atomicWriteFile that uses
a deterministic temp path (<target>.tmp) instead of a unique random
name on every call. This prevents unbounded kernel dentry slab growth
under cgroup v2 when positions are written every 10 seconds.
@AruneshDwivedi
AruneshDwivedi requested a review from a team as a code owner September 5, 2026 07:02
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Signed commits report

1 of 1 commit between main and fix/positions-dentry-slab could not be fully verified:

Commit Author Reason Message
9990b312 Arunesh Dwivedi unsigned fix(positions): use deterministic temp file to prevent dentry slab growth

This repository requires all commits to be signed. See GitHub docs on commit signature verification.

@cla-assistant

cla-assistant Bot commented Sep 5, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@cla-assistant

cla-assistant Bot commented Sep 5, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@kalleep

kalleep commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Hey I believe we can use https://github.com/natefinch/atomic instead of having our own implementation. We already have this as a dependency in alloy

@kalleep kalleep self-assigned this Sep 7, 2026
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.

positions file write uses a uniquely-named temp file every 10s (renameio), causing unbounded kernel dentry slab growth under cgroup v2

3 participants