Skip to content

Commit accecbb

Browse files
committed
feat(client): enhance cancellation handling
1 parent 8b9c322 commit accecbb

3 files changed

Lines changed: 299 additions & 21 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aimdb-core/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8383
clamped to `1..=8192`: the ring is preallocated, so zero could never deliver
8484
and `usize::MAX` would abort rather than mean "unbounded". An evicted `call`
8585
resolves `RpcError::Internal`; an evicted `subscribe` ends its stream.
86+
A cancellation is never the command evicted to make room: `CancelOnDrop` uses
87+
a plain `try_send`, so abandoning a call cannot displace a caller's queued
88+
`Write`.
89+
- **An evicted `CancelCall` no longer re-opens the pending-call leak.** Making
90+
the channel evict-oldest put cancellation on the same lossy footing as data,
91+
and `enqueue` discarded the evictee unexamined — so a `Write` behind a queued
92+
cancellation could displace it, stranding that call's entry until the
93+
connection ended (the leak cancel-safety exists to close, below in *Fixed*).
94+
A lost cancellation now degrades to a *prune* signal and the engine reclaims
95+
by inspection (`oneshot::Sender::is_canceled` identifies the abandoned set
96+
exactly). The sweep is idempotent, so one signal covers any number of losses;
97+
it is `O(N)` but reached only from the eviction path, leaving `O(1)` by-id
98+
removal as the common case.
8699

87100
### Performance
88101

0 commit comments

Comments
 (0)