Skip to content

refactor(coordinator): isolate response cache and refresh ownership - #1006

Closed
Gajesh2007 wants to merge 4 commits into
refactor/coordinator-api-subsystemsfrom
refactor/coordinator-read-cache
Closed

Gajesh2007 wants to merge 4 commits into
refactor/coordinator-api-subsystemsfrom
refactor/coordinator-read-cache

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Response-cache storage, invalidation generations and refresh locks were embedded in the HTTP package. Move their ownership into api/readcache, with focused cache, generation-fence and refresh-coalescing files.

The API keeps endpoint keys, TTLs, refresh schedules and error telemetry. The cache map and mutexes remain private. Catalog fills use typed generation-fenced setters so an in-flight read cannot republish stale data after an admin sync. Refresh failures preserve the previous success only until its original expiry; concurrent misses still share one computation.

Stacked on #1003, after #909 and #997.

Before:

flowchart LR
  R[Catalog / stats request] --> A[api handler]
  A --> C[api ttlCache + Server generation and refresh locks]
  C --> H[Hit: cached response bytes]
  C --> M[Miss: query and fill / coalesce]
  I[Catalog invalidation] --> C
Loading

After:

flowchart LR
  R[Same catalog / stats request] --> A[api handler: key / TTL / schedule]
  A --> C[readcache.Cache and Refresher own synchronization]
  C --> H[Same cached response bytes]
  C --> M[Same query / coalesced fill and expiry]
  I[Catalog invalidation] --> F[Generation fence blocks stale fills]
  F --> C
Loading

Validation:

  • All 26 existing affected cache/catalog/stats tests pass under -race; three pure cases move to the cache owner.
  • All 1,611 prior API test/benchmark/fuzz/example symbols remain discoverable.
  • Existing HTTP tests exercise hit/miss byte equality, TTL expiry, private model views, failed refreshes and admin invalidation racing a fill. They use public cache operations in place of private map access.
  • Independent peer review found no issues in lock ownership, publication fences, fallback/error timing or the moved test assertions.
  • make docs-check passes (280 pages).

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@vercel

vercel Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Ready Ready Preview Sep 14, 2026 1:15am UTC
d-inference-console-ui-dev Ready Ready Preview Sep 14, 2026 1:15am UTC
d-inference-landing Ready Ready Preview Sep 14, 2026 1:15am UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-14T01:29:54.191311Z 615c1bd Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 72cf94d275

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 615c1bd47a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Gajesh2007

Copy link
Copy Markdown
Member Author

Consolidated into #1056 for review and merge after #1094, #1095 and #1096. #1056 contains this branch's exact head (615c1bd47ac0341cfba680f1e6d745b3b0e01e50), including its reviewed fixes, with implementations and regressions reconciled into the coordinator subsystem owners. Closing the component PR to collapse the stack; its branch, commits and review history are retained. Follow #1056 for combined validation and merge status.

@Gajesh2007 Gajesh2007 closed this Sep 16, 2026

This branch had an error being deployed

1 failed and 3 active deployments
Preview – d-inference-console-ui-dev — 615c1bd4 Deployed Sep 14, 2026 by vercel[bot]
Preview – d-inference — 615c1bd4 Deployed Sep 14, 2026 by vercel[bot]
Preview – d-inference-landing — 615c1bd4 Deployed Sep 14, 2026 by vercel[bot]
benchmarks — 615c1bd4 Deployed Sep 14, 2026 by Gajesh2007 via E2E Benchmarks #1153
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