Repository navigation
perf: add S07 capacity harness with cache and telemetry fixes - #343
Conversation
afa66dd to
9481d4d
Compare
必须处理项评审基于 1. [P1] 父进程中断时应先终止并回收负载子进程,再释放 fixture位置:session.py:299–310、外层清理:467–496。 内层只处理 验证: 从实际源码提取该 try/finally,用 Mock 子进程令 修复/验收: 在包括中断在内的退出路径中,先通知自有子进程退出、限时等待,必要时 kill 并 reap,确认结束后再清空句柄和释放租约;补充“只中断父进程”的回归测试。 2. [P2] 应用转移提交后确认丢失,初始化重试会永久卡在重复转移
修复/验收: 重入时查询并核实当前应用归属;已经属于目标组织时补存完成状态,否则再转移。模拟“服务端成功提交、客户端未记录成功”后重跑,应恢复成功;不要简单忽略所有转移错误。 3. [P2] 故障流程必须落盘保存各服务器实例的退出事件位置:faults.py:177、223–230、317–348。
修复/验收: 替换实例前及最终清理后,将带实例标识的完整退出事件写入结果;为非零退出码和强制终止补充断言。保留 #300 排除说明即可,不要求把异常停止直接认定为容量失败。 除第 1 项的无副作用 Mock 复现外,其余为源码及实际 API 契约核对;未执行压测、故障注入或共享服务操作。 4. [P2] 预算授权和矩阵导出必须验证原始证据,不能只相信摘要或文件大小位置:budget.py:55–75、report.py:39–52。
验证: 使用源码函数和临时合成文件,18 行 pilot 仅保留摘要 JSON、完全没有原始 gzip,仍返回 修复/验收: 授权及导出前检查必需产物,验证 gzip 完整性以及事件/样本数与摘要一致性,或校验生成阶段记录的内容摘要;覆盖缺文件、截断、同尺寸损坏。导出仍应保留失败行,但不能标记完整或允许缺证据 pilot 授权。 5. [P2] 不同轮次必须绑定不同测量,不能复用同一个 result结果与 manifest 仅核对 profile/scenario/VU,不检查轮次或测量身份;最终 108 行集合检查只看 manifest。三个不同 round 的行引用同一个 验证: 用源码 修复/验收: 拒绝重复的规范化结果路径和重复 |
建议处理项评审基于 暂无需要单独列出的非阻断建议;本轮确认的生命周期、初始化恢复和证据完整性问题均已列入另一条“必须处理项”评论,不重复降级为建议。 范围说明:已覆盖新增容量工具、配套行为测试与功能 CI;当前 Driver behavior 及三平台 CI 为成功。该结果不代表完整矩阵、soak 或 fault 的容量验收。PR 已明确声明的 #344/#345 前置依赖、空间不足及 #300 排除范围未作为新增缺陷。验证仅包含源码审查、现有 CI 状态及无副作用的本地 Mock/合成产物复现,没有执行压测或故障注入。 |
9481d4d to
b661019
Compare
b661019 to
77ba5c4
Compare
Register the cache counter in the four official profiles, keep export failures separate from legacy INFO logging, and bound labels and values. Preserve optional exporter behavior and pre-start adapter safety; clarify the log-only legacy metric events and custom collector configuration. Refs #343
Retain isolated OAuth flows, tails and owned fixture controls without claiming accepted current-product capacity or running load in shared CI. Reap owned workers before lease release, recover committed transfers, and persist each server instance's shutdown evidence. Seal and replay raw gzip artifacts; bind every row to source/build/fixture provenance and independent measurement identity before admission or matrix export. Reject missing, corrupt, aliased or reused evidence while retaining CSV rows. Cover tool behavior with 56 standard-library regression tests.
…07 driver The fixture server closes connections idle for 60s (idle_connection_timeout is never overridden by the harness), but Session reused one connection forever with no pre-send liveness management. Under production pacing the observer's 60s cadence and VU quota gaps landed on server-closed sockets, so a formal soak would accumulate transport failures and abort after the full two-hour window. Rebuild a connection idle for more than 45s before sending, and retain idle_reconnects counts in result.json (VU aggregate and observer sessions). No retry, no sleep, no change to the measured system; reconnects emit no admission events, keeping the 1:1 accounting intact. Also clear four review leftovers: - guard Sampler metrics-thread cleanup so it cannot mask an init failure - label telemetry_status collected only when the observer actually started, and seal artifacts under the same condition - route the observer discovery control session through the shared pacer - drop the unreachable fault kind from run.py validation (faults run via faults.py, never through run.py argparse) Regression tests cover idle rebuild vs hot reuse, evidence retention, the early-failure telemetry label, and paced observer sessions; a timed simulation of the server idle-close cadence passes 8/8 with 7 reconnects. Full capacity suite: 61 tests OK.
…skips fill The guarded-fill path in introspectToken finished inactive() when the fresh snapshot carried a future nbf, while the authoritative Postgres introspect enforces only revoked/expired. With the cache enabled, a valid token could therefore introspect as inactive whenever the issuance-time clock reading ran ahead of a later reading (observed in the S07 tuned smoke: cold-start client_credentials + introspect failed roughly half the trials; warm trials never failed). Skip the fill and serve the authoritative result instead; the not-yet-cacheable snapshot is simply not cached. Add an integration regression test (future-nbf token, warmed access cache) asserting active verdicts on both calls, impl consulted twice, and no introspection-key fill. Verified red on the pre-fix line (2 failed assertions) and green after the fix (27 assertions).
DrogonMetrics was a log-only stopgap: the "[METRIC]" INFO line never
reached drogon::plugin::PromExporter, so /metrics did not expose the
counters documented in docs/domains/token-refresh-and-revocation.md
(fulla_cache_total{repo="token",outcome=...}). The S07 capacity
harness's cache-proof gate scrapes exactly that family; row
013-introspect_reuse reported cache_path_not_proven despite 100% flow
success because the family never existed on the endpoint.
Register Counter/Gauge collectors lazily with the PromExporter plugin
(sorted label order, duplicate-registration safe across adapter
instances, log-only fallback when the plugin is absent). Histograms
stay log-only: drogon's Histogram requires explicit bucket boundaries
and owns an event-loop thread per metric, and no production call site
observes histograms through this port yet. The legacy [METRIC] log
line is retained for log-scraping consumers. Ratify the additive
api-diff baseline drift (private members only).
Add Integration_P2_Plugin_DrogonMetrics_PromExporterExport: counter
values per label set, gauge set semantics, cross-instance collector
reuse, and the /metrics exposition the driver filters on. Verified red
on the log-only implementation (collector absent) and green after the
wiring (12 assertions).
a7b022c to
c893593
Compare
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c893593c52
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (auto typed = | ||
| std::dynamic_pointer_cast<dm::Collector<dm::Counter>>(collector)) | ||
| { | ||
| typed->metric(labelValues(labels, names))->increment(value); |
There was a problem hiding this comment.
Preserve request counts when exporting counters
When the PromExporter plugin is enabled, this now exposes oauth2_requests_total with inflated values: existing callers pass the HTTP status as value (for example, TokenEndpointController.cc:1130-1134 passes 200, while AuthorizationEndpointController.cc:139-143 passes 400), so each request increments the counter by 200–500 rather than one. Those callers also provide only the endpoint label, omitting the documented status dimension, which makes production QPS/error-rate queries incorrect. Update these emissions to increment by one and carry the status as a label before exporting them as Prometheus counters.
Useful? React with 👍 / 👎.
Register the cache counter in the four official profiles, keep export failures separate from legacy INFO logging, and bound labels and values. Preserve optional exporter behavior and pre-start adapter safety; clarify the log-only legacy metric events and custom collector configuration. Refs #343
#345) Register the cache counter in the four official profiles, keep export failures separate from legacy INFO logging, and bound labels and values. Preserve optional exporter behavior and pre-start adapter safety; clarify the log-only legacy metric events and custom collector configuration. Refs #343
The capacity driver needs isolated OAuth sessions, recoverable setup, owned cleanup and verifiable evidence before any formal campaign can be admitted. This change adds the S07 harness and fixes the cache/telemetry prerequisites exposed by real functional runs.
Changes
The final diff includes the two product fixes above; earlier descriptions of a tooling-only change are superseded. Schema, dependency lock, generated clients and OpenAPI are unchanged.
Validation
Reviewed head:
c893593c52071330dbaae4d53f38c84413d6561d, based directly on masterba76f64b(including #339).Remaining limits and review follow-up
No accepted current-product capacity baseline, formal matrix, long soak or fault sign-off is published. A new matching pilot/budget and sufficient persistent storage remain required. Historical raw evidence stays private and unchanged. Abnormal shutdown outcomes remain separately recorded under the #300 exclusion.
The nonblocking P2 request-counter review is tracked in #355: legacy oauth2_requests_total callers pass HTTP status as the increment and omit its status label, so request-rate queries are inaccurate after export. That follow-up must increment once per request with consistent status labels. The S07 harness does not consume this counter; its request statistics come from retained events and its cache proof uses fulla_cache_total. The review thread remains visible; this is not claimed fixed here.
Approved for the user-requested rebase merge after current-head checks and external approval. No deployment or capacity acceptance is implied.