Skip to content

capnp: settle promises retained by snapshots - #655

Merged
lthibault merged 1 commit into
mainfrom
codex/rpc-snapshot-promise-settlement
Jul 25, 2026
Merged

lthibault merged 1 commit into
mainfrom
codex/rpc-snapshot-promise-settlement

Conversation

@lthibault

Copy link
Copy Markdown
Collaborator

Summary

  • make promise settlement depend on a live promise hook, so retained snapshots still observe fulfillment or rejection after the original client cursor is released
  • keep the cursor weak reference only for best-effort path compression
  • retain unresolved import generations until every live hook shuts down, so earlier snapshots and the current cursor receive one terminal settlement outside the connection lock

Testing

  • focused promise and RPC lifecycle tests, 100 repetitions
  • focused race tests, including 1,000 Resolve-vs-Close repetitions
  • go test ./... -count=1
  • go test -race -short ./... -count=1
  • go vet ./rpc

Closes #653.

@lthibault
lthibault merged commit 64c75ef into main Jul 25, 2026
4 checks 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.

rpc: resolve clientPromise state while snapshots outlive client cursors

1 participant