Skip to content

fix(azure): align divergent PurchaseCommitment guards and display names across services #538

Closed

Description

@cristim

Found while planning #9 (ARCH-02). The 7 Azure PurchaseCommitment bodies (providers/azure/services/<svc>/client.go) diverge in ways that look like bugs. Each is a behavior change, so it is kept out of the #9 refactor:

  • (a) Only synapse rejects a blank ResourceType (synapse:303). The other six send sku.name: "" to Azure.
  • (b) synapse's count-guard message drops the count (synapse:308). The other six say "...got %d".
  • (c) managedredis (:330) and synapse (:339) use a fixed, unsanitized displayName with no region, term or timestamp. The other five use BuildDisplayName.
  • (d) cache (:348) and managedredis (:325) both purchase RedisCache. See fix(azure): the recommendations aggregator never calls managedredis, search or synapse #47 and #1508 for which service owns Azure Redis.
  • (e) compute wraps a term-parse error as "failed to marshal request: %w" (compute:509), and checks the payment option before the term.

Proposed fix: once the #9 shared helper lands, align (a) to (c) and (e) on the majority behavior, each with a test. Settle (d) with the Redis-ownership decision.

Activity

  1. cristim commented on Oct 20, 2026

    @cristim
    MemberAuthor

    Two more items, found while writing the #9 golden tests:

    • (f) With an idempotency token, managedredis's fixed display name becomes "Azure Cache for Redis Reservation -cudly", with a stray space before the dash. The fixed name is cut at its last dash before the marker is appended. synapse gives "...Reservation - GP_Gen5_8-cudly".
    • (g) Pre-existing races, out of scope for ARCH-02: 77-line PurchaseCommitment + pricing helpers copy-pasted across 7-8 Azure service clients #9: capacityProviderOnce (compute) is spent even when the first call is cancelled, and the list-then-purchase window is not atomic. [claude-cc-libs]
  2. cristim commented on Oct 20, 2026

    @cristim
    MemberAuthor

    Claiming items (a), (b), (c), (e) and (f): align the divergent guards, messages, display names and compute's error order on the majority behavior, now that all 7 services share the #9 helper. Item (d), Redis ownership, is an owner decision, and item (g), the pre-existing races, needs its own design; both are listed for the owner. [claude-cc-libs]

  3. cristim commented on Oct 20, 2026

    @cristim
    MemberAuthor

    #550 (merged) fixes items (a), (b), (c), (e) and (f). Item (d), Redis ownership, and item (g), the pre-existing compute and list-then-purchase races, stay open for the owner. [claude-cc-libs]

  4. cristim commented on Nov 5, 2026

    @cristim
    MemberAuthor

    Owner decision (2026-11-05): Option A. managedredis owns Redis purchases; the cache service stops purchasing Redis, with a guard against double-buying. Next: remove Redis purchasing from cache and add the guard.

  5. cristim commented on Nov 5, 2026

    @cristim
    MemberAuthor

    Claimed by claude-nibblets: implementing item (d) per the owner decision (Option A). managedredis stays the only service that purchases Azure Redis; the cache service stops purchasing Redis and refuses before any API call, with a guard against double-buying. Working in a worktree off origin/main, test first; PR to follow.

  6. cristim commented on Nov 11, 2026

    @cristim
    MemberAuthor

    Closing as fixed on main. Items (a), (b), (c), (e) and (f) landed in #550, and item (d) (Redis ownership, Option A) landed in #694: the cache client refuses PurchaseCommitment and managedredis is the only Redis purchaser. The remaining item (g), the compute capacity-provider race and the list-then-purchase window, is filed separately: #745

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions