Skip to content

refactor(coordinator): separate profile and request-outcome queue owners - #1010

Closed
Gajesh2007 wants to merge 5 commits into
refactor/coordinator-observability-subsystemsfrom
refactor/coordinator-profile-subsystems
Closed

Gajesh2007 wants to merge 5 commits into
refactor/coordinator-observability-subsystemsfrom
refactor/coordinator-profile-subsystems

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Profile persistence and request-outcome persistence currently keep unrelated queues, locks, workers and counters inside api. This moves each into its own telemetry package and leaves small API adapters for record construction, current-store lookup and metrics.

  • telemetry/profilequeue owns the sampled profile worker, nonblocking submission, batching and error/drop accounting. Its Close continues to signal shutdown without waiting for buffered records to drain.
  • telemetry/outcomequeue owns the unsampled outcome worker, rejection after close, per-write timeout and bounded drain wait. Its one-second write timeout and two-second outer shutdown bound are preserved.
  • API adapters resolve the current store when a queued write runs. Request classification, profile selection, SQL, response shapes and telemetry vocabulary keep their existing policies.

Stacked on #1008 (metrics and route telemetry), which is based on the coordinator restructuring stack rooted at #909. This is a separate ownership layer so the different shutdown contracts can be reviewed together.

Before:

flowchart LR
  R[Completed request] --> A[api profile and outcome code]
  A --> P[api profilerSink: private queue and worker]
  A --> O[api requestOutcomeSink: private queue and worker]
  P --> S[Current store: profile batch]
  O --> T[Current store: outcome upsert]
  C[Server Close] --> PC[Profile: signal only]
  C --> OC[Outcome: bounded drain]
Loading

After:

flowchart LR
  R[Completed request] --> A[API record and metric adapters]
  A --> P[telemetry/profilequeue: owns queue and worker]
  A --> O[telemetry/outcomequeue: owns queue and worker]
  P --> S[Current store: same profile batch]
  O --> T[Current store: same outcome upsert]
  C[Server Close] --> PC[Profile: same signal-only close]
  C --> OC[Outcome: same bounded drain]
Loading

Validation: full go test -race ./coordinator/... passes across 30 test packages (API 227.544s). Focused profile/outcome/API race checks pass; all 1,616 prior API and telemetry test symbols remain discoverable. Six new boundary cases cover queue behavior and runtime store replacement; the store-replacement case also passes against the original implementation. Independent source and documentation review is clean, and make docs-check passes 280 files. No SQL or provider execution changes are included.

Pinned golangci-lint v2.1.6 now passes after merging the metric-label field annotations from #1008 and removing the single uncalled API crossesPowerOfTen adapter. The actual telemetry helper and both queue callers remain. Independent deletion review and the telemetry race suite pass.

@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 6:56pm UTC
d-inference-console-ui-dev Ready Ready Preview Sep 14, 2026 6:56pm UTC
d-inference-landing Ready Ready Preview Sep 14, 2026 6:56pm 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-14T19:00:18.524987Z 4ee6464 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. Swish!

Reviewed commit: ac89b90c06

ℹ️ 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. Nice work!

Reviewed commit: 9f672fa1e2

ℹ️ 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".

…/coordinator-profile-subsystems

# Conflicts:
#	docs/architecture/system-profiler.md
#	docs/architecture/telemetry.md
#	docs/developer/build.md
#	docs/developer/test.md
@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review

Refreshed the parent branch and resolved documentation/source-map conflicts. Existing subsystem implementations and regression tests are preserved. Exact parent composition and independent review pass; all coordinator test packages compile and documentation checks pass.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 4ee6464155

ℹ️ 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 (4ee646415512cc58f8d110a0ed0e9d36c77db2bc), 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 — 4ee64641 Deployed Sep 14, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — 4ee64641 Deployed Sep 14, 2026 by vercel[bot]
Preview – d-inference-landing — 4ee64641 Deployed Sep 14, 2026 by vercel[bot]
benchmarks — 4ee64641 Deployed Sep 14, 2026 by Gajesh2007 via E2E Benchmarks #1286
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