Repository navigation
fix(session): 将任务登记移出 session 归档锁 - #6175
Merged
qin-ctx merged 1 commit intoOct 16, 2026
Merged
Conversation
qin-ctx
approved these changes
Oct 16, 2026
qin-ctx
marked this pull request as ready for review
October 16, 2026 10:59
Keep task-store latency outside the session critical section. Register queued commits before processing so registration failures preserve recovery work and ordinary Phase-2 failures retain their terminal outcome. Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
qin-ptr
force-pushed
the
fix/session-task-registration-main
branch
from
October 16, 2026 11:02
b7d00c5 to
aa549c6
Compare
qin-ptr
added a commit
to qin-ptr/OpenViking
that referenced
this pull request
Oct 16, 2026
…ne#6175) Keep task-store latency outside the session critical section. Register queued commits before processing so registration failures preserve recovery work and ordinary Phase-2 failures retain their terminal outcome. (cherry picked from commit 7c34e43) Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
11 of 21 tasks
qin-ctx
added a commit
that referenced
this pull request
Oct 16, 2026
…6173) Keep task-store latency outside the session critical section. Register queued commits before processing so registration failures preserve recovery work and ordinary Phase-2 failures retain their terminal outcome. (cherry picked from commit 7c34e43) Co-authored-by: qin-ptr <222410531+qin-ptr@users.noreply.github.com> Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
3 of 4 tasks
qin-ctx
added a commit
that referenced
this pull request
Oct 19, 2026
Keep task-store latency outside the session critical section. Register queued commits before processing so registration failures preserve recovery work and ordinary Phase-2 failures retain their terminal outcome. Co-authored-by: qin-ptr <222410531+qin-ptr@users.noreply.github.com> Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com> (cherry picked from commit 7c34e43)
13 of 21 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
commit 在持有 session 锁时等待 TaskStore 查询和创建记录,会把任务存储延迟扩散到同一 session 的删除操作。
Before: 同一 session 的 commit 卡在 TaskStore.create 时,DELETE 因目录树锁冲突返回 409。
After: 先完成归档、入队和 ready 发布并解锁,再等待任务登记。相同场景下 DELETE 可以返回 200;commit 仍需等任务登记成功后才返回 accepted。
登记失败不回滚已发布的归档,错误 details 保留
task_id、archive_uri、archived=true和stage=task_tracker_create。Human Involvement
Related Issue
无关联 Issue。
Type of Change
Changes Made
Testing
55 项相关测试通过,覆盖 Phase 1 发布、SessionCommit 消费者、恢复执行、任务队列中间件和 NamedQueue 的异常/ACK 行为。相对 main,测试代码净减少 6 行;未新增测试文件、函数或参数化 Case。
Ruff、改动范围格式检查、
git diff --check和禁止新增测试校验通过。Checklist
Screenshots (if applicable)
不适用。
Additional Notes
已变基到
013e988bb并解决测试冲突。#6136 改变的任务入队契约仍有独立问题:普通 session commit 可在入队阶段触发TaskWorkRejected: work is missing owner metadata,新契约还要求任务记录预先存在。本 PR 保持显式任务登记的锁范围调整,不扩展修改任务入口与可靠投递协议。先合入 main,再将 main 提交 cherry-pick 到
codex/v0.4.20-hotfix-work(回补 PR:#6173)。生产代码净增 13 行;队列入队仍在 session 锁内,本次不调整可靠投递协议。