CoderWorkspacePoolMember: recognize a template-wide last_used_at write in a one-member pool
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start from the CoderWorkspacePoolMember logic that compares a workspace's last_used_at with the template's updated_at within a 5 s window, and from the 60 s poll that decides whether a member is Used. Reproduce the case where a template schedule update runs, the template changes again before the next poll, and the pool has one member. Done when that member is no longer marked Used and the single-member and multi-member witness paths are both covered by tests. The suggested fix adds one list call, only when the template time does not match.
由索引模型根据 Issue 内容生成。
描述
Problem
A CoderWorkspacePoolMember treats a later last_used_at as use, except for a template-wide write. It recognizes a template-wide write in two ways: the value is within 5 s of the template's updated_at, or another unclaimed member of the pool already moved its baseline to the same value.
When a template schedule update with update_workspace_last_used_at runs, and the template changes again before the next 60 s poll, and no other member of the pool saw the first write (for example a one-member pool), the member marks itself Used. The pool releases it, and one warm workspace leaks.
This is the fail-safe direction: the controller never deletes a workspace that someone may use. But it costs one workspace per affected member.
Possible fix
Also accept as a witness any other workspace of the template in Coder with the same last_used_at (one list call, only when the template time does not match).
Trigger
Before the PR 12 activation docs of #153, or a user report.
Found by Codex on #343 (comment 4268119093).
Refs #153
Found in review of #343 (thread 4268119093); the plan resolves the ambiguity toward Used, which can leak one warm workspace but never deletes possible work.
Refs #153
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: medium
- 主要语言
- Go
- 星标
- 5
- 派生
- 3
- 平均合并
- 3 小时
- 30 天内合并 PR
- 192
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
coder/coder-k8s 的其他 Issue
-
CoderWorkspacePoolMember checkCreate: trust only Coder's own 404 on the name lookup (before PR 12)未关闭
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
TestReconcile_LicenseRotationUploadsNewSecretValue fails at -count=3 (reuses a control plane name)未关闭
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
CoderMCPServer Kind E2E follow-ups可能已有人在做 @ThomasK33 于 5 天前认领。 未关闭
coder/coder-k8s#390 · 已指派 1 人 ·
维护者通常 1 天内回复
-
CoderMCPServer delete and RBAC test follow-ups可能已有人在做 @ThomasK33 于 5 天前认领。 未关闭
coder/coder-k8s#378 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Ownership proof for Coder IDs recorded in controller status (D11 B)可能已有人在做 @ThomasK33 于 5 天前认领。 未关闭
coder/coder-k8s#372 · 已指派 1 人 ·
维护者通常 1 天内回复
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 83/100
devlikeapro/waha#2322 ·
维护者通常 2 天内回复
-
validateDeclaredPath lets control characters through into the Gradle init script's Groovy literal未关闭agent-butler-finding agent-research bug ready-for-agent
难度 2/5 1-3 小时 新手友好度 78/100
jordansmall/spindrift#5821 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
[rmqctl][Bug] Windows build script fails when the output directory is absent可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
apache/rocketmq-dashboard#7243 ·
维护者通常 3 天内回复