Skip to content

fix(session): defer release until pending transactions finish - #178

Merged
shuk777 merged 1 commit into
Edge0-AI:mainfrom
Afloat16:fix/20261111-session-pending-release
Nov 16, 2026
Merged

shuk777 merged 1 commit into
Edge0-AI:mainfrom
Afloat16:fix/20261111-session-pending-release

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

What & why

Deferred release currently uses inconsistent conditions. request_release waits for active uses and pending transactions, but end_use can free KV storage while a transaction is still pending. Conversely, committing or interrupting a transaction never completes an already-requested release when no outer use remains.

Wait for both active uses and pending updates before cleanup, and finish deferred release when a commit or interruption clears the last update. The release callback still runs once.

Area

  • Engine, CLI or server (edge0-infer/)

How was it tested?

Built moe_test_session_transactions and ran ctest --preset cpu -R '^moe_test_session_transactions$' on CPU: passed. The new regression fails against the base revision.

The six added lifecycle cases combine an optional outer use with commit, pre-submit interruption, and post-submit interruption. They verify that KV storage remains allocated while the update is pending, cleanup runs exactly once, and the budget returns to zero immediately after resolution.

The CPU build uses diagnostic demotions for pre-existing GCC 14 warnings; no external model assets are required.

Checklist

  • Added lifecycle and budget regressions
  • Existing transaction, reset and deferred-release tests pass

@shuk777 shuk777 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@shuk777
shuk777 merged commit 8d0c0a3 into Edge0-AI:main Nov 16, 2026
1 check passed
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