Skip to content

send an idempotency key on lease extend - #121

Merged
bpapillon merged 1 commit into
mainfrom
bpapillon/sch-7476-sdk-lease-acquire-and-extend-retry-without-an-idempotency
Sep 17, 2026
Merged

bpapillon merged 1 commit into
mainfrom
bpapillon/sch-7476-sdk-lease-acquire-and-extend-retry-without-an-idempotency

Conversation

@bpapillon

Copy link
Copy Markdown
Collaborator

The lease wire client already let the generated credits client retry acquire and extend under the default policy, and extend carried no idempotency key, so a 502 arriving after the server committed the growth would grow the lease twice. The API now accepts an idempotency_key on extend (schematic-api #8556); acquire has always handed back the slot's existing active lease.

Extend now mints one UUID per call and sends it as the key. The retry loop resends the same body, so every attempt of one extend collapses to a single grow while a later extend gets its own key. The check-and-reserve path still carries no key and keeps its no-retry setting.

Tests drive the generated client over a mock transport that replays 502 then 200: extend sends the same key on both attempts and the manager applies the response once, acquire installs the lease from the 200, and two extends carry different keys.

@bpapillon
bpapillon requested a review from a team as a code owner September 16, 2026 23:53
@bpapillon
bpapillon merged commit e3ea339 into main Sep 17, 2026
6 checks passed
@bpapillon
bpapillon deleted the bpapillon/sch-7476-sdk-lease-acquire-and-extend-retry-without-an-idempotency branch September 17, 2026 00:09
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.

2 participants