Skip to content

Remote comms: Promise rejection on give-up #686

@sirtimid

Description

@sirtimid

Problem: When we give up on a remote (after max retries or non-retryable error), we clear the message queue but don't reject promises where that remote is the decider. This leaves promises in an unresolved state indefinitely, causing memory leaks and blocking application logic.

Expected Behavior:

  • When reconnection gives up on a peer, find all kernel promises where that peer is the decider
  • Reject those promises with an appropriate error (e.g., "Remote peer unreachable")
  • Clear related state (similar to how VatHandle.terminate() handles promise rejection)

Implementation:

  • Add logic in attemptReconnection when maxAttempts is reached or non-retryable error occurs
  • Query kernel store for promises where the peer is the decider
  • Reject found promises using kernel promise rejection APIs
  • Reference VatHandle.terminate() implementation for pattern
  • Coordinate with RemoteManager to access kernel promise APIs

Acceptance Criteria:

  • Promises are rejected when reconnection gives up
  • Rejected promises have appropriate error messages
  • No memory leaks from unresolved promises
  • Tests verify promise rejection on give-up scenarios

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions