Skip to content

fix(memory): resample unthrottled after allocator trim - #2856

Closed
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1790906115-rebase-2596
Closed

devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1790906115-rebase-2596

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Follow-up to the cgroup-pressure fix from fix(memory): resample pressure right after allocator trim #2596, which has since landed on master (1bdded9). This branch was rebased onto master and now contains only the fix below.
  • The allocator-trim reclaimer called the throttled sample_for_checkpoint(). If an indexing checkpoint had sampled within the last RESIDENT_MEMORY_CHECKPOINT_SAMPLE_INTERVAL_V1, the post-trim read was skipped. run_pressure_reclaimers does not resample afterwards, so the OverBudget latch stayed up after memory had recovered. Admissions kept returning ObservedOverBudget until the maintenance sampler ran again, which can take about 30s.
// trim reclaimer
- pressure.sample_for_checkpoint();        // throttled; may return stale state
+ pressure.publish_post_reclaim_sample();  // canonical sampler, unthrottled, no reclaimer reentry

Motivation

Raised in Devin Review on this PR. Without this fix, an allocator trim that brings cgroup usage below the low watermark can leave admission refused.

Changes

  • crates/tracedecay-runtime-core/src/resident_memory.rs: new private publish_post_reclaim_sample, called from register_process_allocator_pressure_reclaimer_v1.
  • crates/tracedecay-runtime-core/src/resident_memory/tests.rs: allocator_reclaim_publishes_recovery_after_recent_checkpoint. A checkpoint arms the throttle, then a priority-0 owner reclaimer lowers the canonical reading, then the trim runs. The test asserts the state is Nominal and reserve succeeds.

Test plan

  • cargo test -p tracedecay-runtime-core --lib resident_memory: 52 passed (after the rebase onto master)
  • cargo fmt --check -p tracedecay-runtime-core
  • Full cargo nextest run --workspace is left to CI

Checklist

  • CHANGELOG.md updated (not done)
  • No secrets, credentials, or .env files included
  • No breaking changes

Link to Devin session: https://app.devin.ai/sessions/26e8a6e6fdd04bc3ba3661c3b6a1869b
Open in Devin Desktop: https://app.devin.ai/desktop/session/26e8a6e6fdd04bc3ba3661c3b6a1869b?variant=devin
Requested by: @ScriptedAlchemy


Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@changeset-bot

changeset-bot Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a017a1e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

devin-ai-integration[bot]

This comment was marked as resolved.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1790906115-rebase-2596 branch from 225a0c9 to a017a1e Compare October 2, 2026 02:29
@devin-ai-integration devin-ai-integration Bot changed the title fix(memory): retain cgroup pressure after allocator trim fix(memory): resample unthrottled after allocator trim Oct 2, 2026
@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Superseded by #2851 (merged, e969511), which carries this fix plus the lexical-path correction.

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.

1 participant