Skip to content

demo(counter): capture process memory on suspend (onCommit: Full)#521

Closed
Gabor Pikats (mcftira) wants to merge 1 commit into
agent-substrate:mainfrom
mcftira:fix/counter-demo-oncommit-full
Closed

demo(counter): capture process memory on suspend (onCommit: Full)#521
Gabor Pikats (mcftira) wants to merge 1 commit into
agent-substrate:mainfrom
mcftira:fix/counter-demo-oncommit-full

Conversation

@mcftira

Copy link
Copy Markdown

Fixes #519

The counter demo promises state preservation across suspend/resume, but shipped onCommit: Data - so suspend checkpoints took the runsc fscheckpoint branch (filesystem only) and process memory was never captured. On resume, actors cold-booted with only the DurableDir restored: the demo's own preserved memory count reset to 1 on every suspend.

With onCommit: Full, suspend captures a full runsc checkpoint (memory + fs) and resume restores it via runsc restore.

Verified end-to-end on kind (create-kind-cluster.sh + install-ate-kind.sh): 3 POSTs (memory 3, file 3) -> suspend -> resume POST now returns preserved memory count: 4 | preserved file counter: 4 (previously memory reset to 1 while file continued to 4).

  • Tests pass (no new code paths; this aligns the shipped demo with the onCommit:Full, onPause:Full case already covered by TestDurableDirLifecycle, plus manual end-to-end verification above)
  • Appropriate changes to documentation are included in the PR (none needed - the demo README already promises this behavior)

The demo promises state preservation across suspend/resume, but shipped
onCommit: Data, so suspend checkpoints took the runsc fscheckpoint branch
(filesystem only) and process memory was never captured. Actors cold-booted
on resume and the demo's own preserved-memory counter reset every time.

With onCommit: Full, suspend captures a full runsc checkpoint (memory + fs)
and resume restores it via runsc restore.

Fixes agent-substrate#519
@mcftira

Copy link
Copy Markdown
Author

All yours 😄 Closing as dupe of #520. FWIW I verified the same fix end-to-end on kind - memory counter continues across suspend/resume - so consider this an independent confirmation.

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.

Counter demo: in-memory state not preserved across suspend/resume (gVisor, kind), despite onPause: Full

1 participant