Skip to content

rpc: finish imported promises during shutdown - #650

Merged
lthibault merged 2 commits into
mainfrom
codex/rpc-import-promise-shutdown
Jul 25, 2026
Merged

lthibault merged 2 commits into
mainfrom
codex/rpc-import-promise-shutdown

Conversation

@lthibault

@lthibault lthibault commented Jul 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • reject still-unresolved imported senderPromises that retain a live client cursor when the connection shuts down
  • consume promise resolvers atomically on normal Resolve, so shutdown cannot deliver a second terminal callback
  • preserve promise behavior when an unresolved import is re-received after its prior client cursor is released
  • run resolver callbacks outside Conn.lk; connection shutdown waits for them unless AbortTimeout elapses

Testing

  • go test ./... -count=1
  • go test -race -short ./... -count=1
  • go vet ./rpc
  • focused lifecycle tests: 100 normal iterations and 20 race-enabled iterations

Stack

#645 has landed. This PR is retargeted to main.

@lthibault
lthibault changed the base branch from codex/rpc-late-resolve-cleanup to main July 25, 2026 14:53
@lthibault
lthibault merged commit 07bcc06 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.

1 participant