CoderWorkspacePool: use after the last read can still be bound or deleted on a delete retry
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Read the two threads on PR #404 first, then bindClaims in internal/controller/coderworkspacepool_claim.go and cleanupStep in internal/controller/coderworkspacepoolmember_cleanup.go to see where each check sits relative to the delete/bind boundary. Before writing anything, answer the open question in the issue: does Coder move last_used_at on a failed delete build? A failed-delete test against the member cleanup path is the place to establish that. Done means both paths re-check use at the boundary, existing reconciler tests still pass, and the residual flush-delay window is documented.
由索引模型根据 Issue 内容生成。
描述
Problem
Two paths can still hand out or delete a pool workspace that someone used after the member's last read of Coder. Codex found both on #404. Both exist on main and are outside #349, which #404 fixes.
- Bind uses stored status.
bindClaims(internal/controller/coderworkspacepool_claim.go) picks members by their storedReadyandUsedconditions. A member readslast_used_atonce a minute. Use after that read and before the next one is not in status yet, so a new claim can bind the workspace. The resourceVersion precondition cannot see a change in Coder. Thread: https://github.com/coder/coder-k8s/pull/404#discussion_r4424757093 - No use check before a delete retry.
cleanupStep(internal/controller/coderworkspacepoolmember_cleanup.go) runs the last use check only before the first delete build (DeleteBuildID == "" && DeleteAttempts == 0). If that build fails or is canceled and someone uses the workspace during the retry backoff, the retry deletes it. Thread: https://github.com/coder/coder-k8s/pull/404#discussion_r4424757101
Neither path can close the gap fully. Coder records use up to one usage flush (about 60 s) late, and it has no conditional delete or bind. The fixes narrow the window to that flush delay.
Possible fix
- Read the workspace from Coder at the bind boundary and skip a member whose
last_used_atis past itsreadyLastUsedAt. - Run the last use check before every new delete build, not only the first. Check first whether Coder moves
last_used_aton a failed delete build. If it does, every failed delete would release its member (a leak, the fail-safe side).
Trigger
Before #153 PR 12 registers the pool reconcilers.
Owner: maintainer desk.
Refs #153
Refs #404
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: xhigh
- 主要语言
- Go
- 星标
- 5
- 派生
- 3
- 平均合并
- 2 小时 49 分钟
- 30 天内合并 PR
- 206
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
coder/coder-k8s 的其他 Issue
-
难度 3/5 半天 新手友好度 62/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
-
难度 3/5 半天 新手友好度 45/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 30/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 8/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
apache/arrow-swift#209 ·
维护者通常 1 天内回复
-
orchestrator: NFS-cache "cache path is not set" WARN logged on every build/launch instead of once可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
难度 1/5 1-3 小时 新手友好度 65/100
influxdata/telegraf#20031 ·
维护者通常 1 天内回复
-
pkg/registry/file no longer builds for GOOS=windows: unguarded syscall.Stat_t in qualified_resource_migration.go可能已有人在做 @AnshulPatil2005 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
OneBusAway/maglev#1914 ·
维护者通常 2 天内回复