Skip to content

fix: let Recall's final delivery rows use the remaining shutdown budget - #1325

Merged
kvlonge merged 4 commits into
mainfrom
fix/recall-final-rows-budget
Nov 6, 2026
Merged

kvlonge merged 4 commits into
mainfrom
fix/recall-final-rows-budget

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Why

When a Recall session closed, its final delivery-summary rows were capped at 500 ms even when most of shutdown_timeout remained. A single slow hosted-store response therefore marked a fully delivered transcript incomplete. CI saw this on Windows: every stream was delivered, yet the session reported "Recall delivery deadline expired".

Changes

  • The final delivery rows now use whatever remains of the shutdown budget, with a 500 ms floor. close still returns by the shutdown deadline, so shutdown_timeout still caps the delay at exit, as the docs describe.
  • Because of the floor, rows that finish within 500 ms of the deadline can land after close has returned and reported history incomplete. The store, which is the source of truth, is then correct and the CLI under-reports, which is the safe direction.
  • Two writer tests use a hosted store whose final rows are slow:
    • final rows that take 1.5 s inside a 5 s budget record complete;
    • final rows slower than a 1 s budget still close within it and report incomplete.
    • Both cases assert the deadline the store receives for the final rows is within the shutdown budget.

Verification

  • The first new case fails on the previous code, matching the CI failure, and passes with the fix.
  • With the final rows given a 30 s deadline instead, the tests fail.
  • cargo test -p sqlbuild-recall: 67 passed.
  • The orchestration test_reads test passes against PostgreSQL.
  • clippy, fmt, fensu and make check-ci pass.
  • DuckShop edge case: not applicable, because this changes Recall delivery timing, not a project shape, data value or lifecycle sequence.

The delivery summary rows written when a session closes were capped at
500 ms even when most of shutdown_timeout remained, so one slow hosted
store response marked an otherwise fully delivered transcript incomplete.
They now get the rest of the shutdown budget, and at least 500 ms; close
still returns by the shutdown deadline.
@kvlonge
kvlonge enabled auto-merge (squash) November 6, 2026 12:00
@kvlonge
kvlonge merged commit 04e98cb into main Nov 6, 2026
47 checks passed
@kvlonge
kvlonge deleted the fix/recall-final-rows-budget branch November 6, 2026 21:21
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