Skip to content

Fix credit lease issues found reviewing the C# port - #199

Draft
bpapillon wants to merge 4 commits into
mainfrom
fix-credit-lease-review-issues
Draft

bpapillon wants to merge 4 commits into
mainfrom
fix-credit-lease-review-issues

Conversation

@bpapillon

Copy link
Copy Markdown
Contributor

Follow-up to review findings on the C# port of credit leases (schematic-csharp#195). Node is the reference, so these bring it in line with the fixed C# behavior.

  • Skip the refund when a reservation has no lease id, in both reservation stores. The Redis refund script treats an empty lease id as "no pin", so the refund landed on whichever lease held the slot and could inflate a successor. Fleets mix SDKs on one Redis, so every SDK has to agree here.
  • Cap a check's wait on another caller's in-flight acquire at the deadline the check started on. It was uncapped, so a short-timeout check could wait out a prewarm's full acquire. (Extend joins already did this.)
  • A caller that joins an extend now checks the result against its own need. The flight re-checks against its starter's need and may skip the wire call when a sibling's extend landed first, leaving the joiner short.
  • A failure listing leases on close is logged instead of rejecting close() and skipping the rest of shutdown.

Did not apply: server reservation rounding (already sends ceil(usage)), work under a lock (single-threaded; the store's key chains run no user code), datastream poller leak (the constructor starts nothing; the poller starts last in start()), expiry time zones (Date is an absolute instant; the stores compare getTime()), drain busy loop (cleanup runs before the awaited promises settle, and every pass awaits).

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