Repository navigation
fix(runtime): contain timed-out inference persistence - #810
mergify[bot] merged 6 commits into
Conversation
|
审查 head 已检查全部 5 个变更文件、相关调用方和 SQLx 0.8.6 的连接归还实现;本轮读取时 PR 没有历史 review/comment。 Happy path
[P1] Cancellation-safe 保护尚未覆盖同一超时调用链的错误重读和 settlement SQL 这是本次故障修复的覆盖缺口,不是声称这些普通-pool 调用由本 PR 首次引入:
这里的具体风险是取消后继续占用 pool 容量,不必假设脏连接已经被另一个业务请求复用:SQLx 0.8.6 源码显示普通 Drop 会异步进入 需要补的 unhappy-path 回归
验证限制 本轮完成静态调用链与依赖源码核查,没有运行 cargo test 或真实 MatrixOne 复现:当前环境没有 cargo/rustc。PR body 中已有测试结果属于作者报告,本轮没有重复验证。读取 CI 时 Test Suite(含 online lanes)及 Static Checks 仍在运行,未把它们视为通过。以上问题是源码证据支持的修复遗漏,不是实测故障报告。 |
|
Fixed in
Verified with workspace lint/format checks, services/runtime compilation, focused unit tests, and compilation of the MatrixOne integration test. The live MatrixOne test is left to online CI because |
|
复审 上轮指出的 admission 错误重读、uncertain-admission recovery、settlement debt 写入与直接 reconciliation 已接入 cancellation-safe guard,这部分修复已确认。 [P1] 最终 terminal mirror 仍位于 timeout 内,却没有保护它实际使用的 checkout 调用方 对 前面的 建议把 finalizer 的每次 checkout(包括幂等 cleanup 和错误重读)也纳入同一 cancellation-safe 执行模型。避免在持有一个 guarded checkout 时再通过 pool 嵌套获取另一个连接,以免小连接池产生等待。 Happy / unhappy path 核查:
本次结论基于最新代码及 GitHub CI 实际日志;未在本地重新运行 Rust/数据库测试。 |
|
Fixed in
Verified with |
|
复审 head 已修复 / happy path
[P1] Provider attempt 的 admission / terminal persistence 仍未使用 cancellation-safe checkout 这不是继续质疑已修复的 logical finalizer,而是相邻的物理请求持久化路径。生产 ControlledProviderAttemptObserver 在
一个直接可达的 unhappy path:provider 已成功返回,另一个事务持有 invocation 行锁;成功结算进入 这是原故障修复的剩余覆盖缺口,不是这次提交新引入的 SQL 回归;它也与 PR body 中“every inference operation invoked beneath the foreground/coordinator cancellation boundary uses the shared guard”的保证不符。 建议把上述三个入口及其恢复 helper 一起纳入同一 guard 执行模型,保持连接顺序获取。补充饱和小池回归:分别阻塞 attempt admission、成功 combined settlement、失败 attempt settlement,触发各自取消/deadline,在锁未释放时验证健康查询能够获得替换容量;同时验证 exact terminal 重放和禁止重复 provider delivery 的语义保留。现有新增测试仅调用 uncertain-admission recovery、debt declaration 和 logical finalizer,尚未覆盖这三个入口。 验证状态 本轮完成最新增量、相关生产调用链和测试代码核查,未本地运行 Rust/MatrixOne 测试。发评论前,当前 SHA 的 Static Checks 与 Test Suite 仍为 |
|
Fixed in
Verified locally with |
|
复审 head 已修复 / happy 与 cancellation path
[P2] 先拒绝 terminal invocation,导致 exact successful replay 到不了幂等判断 新增测试 inference_execution_db_it.rs:537–544 第二次调用 第二次调用会先执行 lock_combined_successful_inference_settlement。它调用 validate_admitted_owner,仅允许 所以这个新增测试按当前控制流会在 exact replay 的 expect 处失败,后面的 failed-terminal 取消场景也无法执行。这也说明 PR body/回复中的“successful terminal replay remains idempotent”目前不成立。该前置校验原先已存在;本轮是新增回归和声明暴露了这个问题,并非 guard 改动新引入状态校验。 建议在 admitted-only 校验之前识别已 terminal 的精确重放,使用 guarded 查询同时核对 logical fingerprint、physical terminal 和 attempt identity;完全一致才返回 Ok,冲突 payload/identity 仍拒绝。也要考虑并发提交后由 admitted 变成 terminal 的重放窗口,不能单纯删除 owner 或 open-attempt 校验。 验证状态 本轮依据完整新旧代码差异和测试控制流核查,未在本地运行 Rust/MatrixOne;上述失败是源码可确定的路径,尚未声称 CI 已实测失败。当前 SHA 的 turn-core/services/plan job 已通过;online core、其余 Test Suite 和 Static Checks 在最近读取时仍运行中。请实际执行 |
|
Fixed in
Verified with |
|
复审 head Happy path / 上轮问题
Unhappy / concurrency path
验证范围 本轮做了新旧源码对照、相关 helper/状态校验和测试代码审查,没有本地运行 Rust/MatrixOne。作者报告的编译及单元测试结果属于其本地验证。当前 SHA 的 Test Suite、Static Checks 及 online core 最近读取时仍在运行,尚不能确认扩展后的数据库测试已实际通过。 |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review of bfb6078 against main (513eb7a). No actionable findings.
Read all six changed files, including the new database regressions. Traced checkout/transaction ownership through admission, physical terminal persistence, combined successful settlement, debt declaration, point reconciliation, terminal mirroring, and the changed run-owner/provider-boundary operations. On the modified cancellation paths, the transaction borrows the guarded connection, so dropping the operation also drops the guard without releasing the checkout for reuse. Write/commit recovery drops the original checkout before acquiring its guarded replacement. Successful paths release after the awaited work completes.
Checked combined-success replay against the locked invocation: owner token/generation, admission token, logical terminal status/fingerprint, and physical attempt identity/terminal fingerprint must match. Replay does not authorize another provider delivery. Settlement backoff retains the exact job and reservation while releasing the worker to serve other queued jobs; the delay grows to its cap.
Validation: git diff --check passed; the head is unchanged immediately before review submission. Static Checks succeeded; Test Suite was still running at the last check. Cargo and a live test database are unavailable here, so Rust tests and the MatrixOne cancellation regressions were not independently executed. This approval is based on code review and does not assert that the live database tests passed.
Merge Queue Status
This pull request spent 21 minutes 56 seconds in the queue, including 21 minutes 41 seconds running CI. Required conditions to merge
|
Summary
Prevent timed-out durable inference work from returning a physical MySQL/MatrixOne connection to the shared pool while its protocol exchange may still be active.
Related issue
N/A — diagnosed from an environment incident; no public issue exists.
Change type
User and compatibility impact
No API, configuration, schema, or migration changes. Under database lock contention, cancelled inference admission, provider-attempt persistence, reconciliation, and settlement work no longer retain shared-pool capacity, and retained settlement debt retries progressively up to a 60-second interval instead of retrying continuously.
Architecture and complexity delta
Verification
make lint— passed (workspace Clippy with warnings denied).make format-check— passed.cargo check -p astra-services --lib— passed.cargo check -p astra-runtime --lib— passed.cargo test -p astra-services inference_execution::tests --lib— 16 passed.cargo test -p astra-services provider_boundary_authorization_is_exact_and_bounded_in_memory --lib— 1 passed.cargo test -p astra-runtime provider_settlement_retry_backoff_is_exponential_and_capped --lib— 1 passed.cargo test -p astra-services --test inference_execution_db_it --no-run— passed.git diff --check— passed.FOR UPDATE, exact-terminal debt cleanup, provider-attempt admission, successful combined provider/invocation settlement, and failed provider-attempt terminal settlement. Each case cancels the caller, proves an independent healthy query can replace the discarded checkout before the blocker is released, then verifies the exact retry semantics; provider-attempt admission additionally proves replay cannot authorize duplicate provider delivery.ASTRA_TEST_DB_ITis not configured in this worktree; online CI owns execution against its isolated database.Final checklist