test: no test covers a sync-dispatch slot waiter whose request ends

已關閉 適合新手
#151 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
76/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
go
領域
testing

研究方向

從 runtime.go 中的 acquireConcurrencySlot 和現有的 TestConcurrentSlotWaiterAbandonedAtDetachTimeout 測試開始。新增一個使用 testing/synctest 的 DispatchSync 案例,佔用唯一的 slot 並取消等待者的請求 context。完成標準是 handler 不會執行,且放棄行為可被觀察到。

由索引模型根據 Issue 內容生成。

描述

enhancement ready-for-agent

No test covers a DispatchSync slot waiter whose request context ends while it waits for a concurrency slot.

What happens

The independent verifier of #150 changed the abandon branch of acquireConcurrencySlot (runtime.go#L1242) to wait for the slot and then return true. So a waiter whose context ended would still run its handler. #150's new test catches that under DispatchDeferred, where the context is the DetachTimeout one. Under DispatchSync the same branch serves a waiter whose request context ends, for example when the platform's client gives up. With the change in place, the root suite still passed, so nothing pins the sync path.

Possible fix

Add a DispatchSync test where the only slot stays held and the waiter's request context is cancelled. Assert that its handler never runs and that the abandon is observable. Use the same testing/synctest pattern as TestConcurrentSlotWaiterAbandonedAtDetachTimeout.

Owner and trigger

The coder/chat maintainer triages this. Add the test with the next change to the concurrent strategy.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: xhigh

主要語言
Go
星號
2
分支
0
平均合併
7 小時 37 分鐘
30 天內合併 PR
26

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

coder/chat 的其他 Issue

查看 coder/chat 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。