feat(orch): re-enable memory.peak per-FD reset (cgroups v2)#2430
feat(orch): re-enable memory.peak per-FD reset (cgroups v2)#2430
Conversation
Now that we run on kernel 6.12+ (ubuntu24), re-enable per-FD peak reset for memory.peak. Each GetStats() call reads the interval peak and writes "0" to reset it, giving per-sample granularity instead of lifetime-only tracking. Restores: 8cf9d74 ("fix: disable memory.peak per-FD reset (requires kernel 6.12+) (#1959)")
PR SummaryMedium Risk Overview Reviewed by Cursor Bugbot for commit 34d1e0d. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f615ca8. Configure here.
When the O_RDWR open fails, memoryPeakFile is nil and peak tracking is skipped entirely (MemoryPeakBytes stays 0). The old message claimed "will track lifetime peak", which was false. Corrected the message and promoted it from Debug to Warn, since this silently disables peak tracking and should be visible in production logs.
If ParseUint fails, the function was returning (0, nil) — a bogus zero peak that looks valid to the caller — and then resetting the kernel peak counter, permanently losing the real data with no error signal. Now return an error instead, so the caller knows the read failed and the kernel peak is preserved for the next attempt.

Now that we run on kernel 6.12+ (ubuntu24), re-enable per-FD peak reset for memory.peak. Each GetStats() call reads the interval peak and writes "0" to reset it, giving per-sample granularity instead of lifetime-only tracking.
Restores: 8cf9d74 ("fix: disable memory.peak per-FD reset (requires kernel 6.12+) (#1959)")