Harden recall and capture reliability - #78
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
| await captureSessionEnd(sessionID); | ||
| snapshots.delete(sessionID); | ||
| activeSessions.delete(sessionID); | ||
| if (await captureSessionEnd(sessionID)) { |
There was a problem hiding this comment.
P2 — Retry terminal capture before disposal completes. Retaining the failed batch in these in-memory maps only helps if another lifecycle event arrives. On server.instance.disposed, this is the final event: a transient failure or the new 3-second timeout makes captureSessionEnd() return false, this handler returns, and process exit discards the only retry state. The stable customId makes a bounded retry safe, so please retry pending terminal batches inside this disposal path (or persist them outside process memory).
There was a problem hiding this comment.
more of a fall open kind of thing, i think we should have this? what do you think @sreedharsreeram
There was a problem hiding this comment.
I agree the hook should fail open. My concern is narrower: retaining the batch in these maps only enables retry if another lifecycle event arrives, but server.instance.disposed is the terminal event and process exit discards the maps. A bounded retry within the existing shutdown deadline would still fail open while covering one transient timeout; after that it can return and allow shutdown. If accepting possible loss of the final batch is intentional, the current behavior is consistent with that tradeoff.
Merge activity
|
Keeps recall fast and useful while making automatic capture bounded, nonblocking, and retry-safe.
316695f to
c5f31a5
Compare
2a8b3fa to
d108824
Compare
The base branch was changed.

Keeps recall fast and useful while making automatic capture bounded, nonblocking, and retry-safe.