render: docker engine discards the network-removal error, so crossplane-render-* networks leak silently
维护者通常 3 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- docker, go
调研方向
Start with the cleanup returned by Engine.Setup in cmd/crossplane/render/engine_docker.go, then trace its deferred use in xr/cmd.go and op/cmd.go around StopFunctionRuntimes. Reproduce the start-failure or slow-stop cases from #396 and #397, and verify that a failed network removal becomes visible to the caller or command instead of being discarded.
由索引模型根据 Issue 内容生成。
描述
What happened?
The temporary crossplane-render-* network the docker render engine creates is left behind whenever a
container is still attached to it at cleanup time, and nothing reports the failure.
The cleanup returned by the docker engine's Setup discards its error
(engine_docker.go L106-L108):
cleanup := func() { //nolint:contextcheck // Detached context for cleanup.
_ = removeRenderNetwork(context.Background(), networkID)
}
In xr/cmd.go and op/cmd.go this cleanup is deferred before StopFunctionRuntimes, so it runs last,
which is the right order. But if any container was leaked (#396, #397), it is still attached to the
network, NetworkRemove fails because the network has active endpoints, and the error is dropped. The
cleanup func signature (func()) means callers can't learn about it either.
Expected: a network-removal failure is reported (returned to, or at least logged visibly for, the caller),
so it doesn't vanish silently.
This affects library consumers that call Engine.Setup as well as the render commands.
How can we reproduce it?
Run either the start-failure reproduction from #396 or the slow-stop reproduction from #397. The run's network is still
there afterwards:
$ docker network ls --filter name=crossplane-render- --format '{{.CreatedAt}} {{.Name}}'
2026-09-30 18:55:29 -0400 EDT crossplane-render-b2rvl4jh
Once the leaked containers are removed by hand, docker network rm on the same network succeeds.
In our testing, every run that leaked a container also leaked its network (the start-failure run, all 7
slow-stop trials, and both interrupted runs from #400); each network's creation time matched its run.
Runs where every container was removed left no network. That points to the attached containers as what
makes network removal fail.
Possible fixes:
- Return or log the
removeRenderNetworkerror instead of discarding it. Changing theSetupcleanup's type
fromfunc()tofunc() errorwould let callers handle it, though that changes theEngineinterface. - Optionally, before removing the network, disconnect or force-remove any render-owned containers still
attached to it. That would be much safer once render-created resources are labelled (#401), because a
user-supplied--crossplane-docker-networkmay have unrelated containers on it.
What environment did it happen in?
- Crossplane CLI version: built from
main@29316fea54f2ede9d2c039d9c54f0c29cbad4b65 - Platform (e.g., linux/amd64): darwin/arm64, Docker Engine 29.5.3 (Rancher Desktop)
- Crossplane version (if applicable): render engine image
xpkg.crossplane.io/crossplane/crossplane:stable
- 主要语言
- Go
- 星标
- 19
- 派生
- 33
- 平均合并
- 3 天 10 小时
- 30 天内合并 PR
- 24
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
crossplane/cli 的其他 Issue
-
`credsStore` in docker config causes unit test failures可能已有人在做 @sujeito-operator 于 48 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 84/100
crossplane/cli#282 ·
维护者通常 3 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 42/100
crossplane/cli#410 ·
维护者通常 3 天内回复
-
render: label the Docker containers and networks render creates可能已有人在做 @jcogilvie 于 5 天前认领。 未关闭enhancement
难度 4/5 3-5 天 新手友好度 48/100
crossplane/cli#401 ·
维护者通常 3 天内回复
-
render: interrupting with Ctrl+C (SIGINT/SIGTERM) leaks Function containers, the render container, and the network可能已有人在做 @jcogilvie 于 5 天前认领。 未关闭bug
难度 3/5 1-2 天 新手友好度 68/100
crossplane/cli#400 ·
维护者通常 3 天内回复
-
render: Function cleanup failures are invisible without --verbose可能已有人在做 @jcogilvie 于 5 天前认领。 未关闭bug
难度 3/5 1-2 天 新手友好度 70/100
crossplane/cli#399 ·
维护者通常 3 天内回复
相似的 Issue
-
needs-area needs-kind needs-priority needs-status needs-triage
难度 2/5 1 小时以内 新手友好度 85/100
cncf/automation#736 ·
维护者通常 1 天内回复
-
kind/bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Telegram webhook: line breaks lost since switch to rich messages可能已有人在做 @Kshot3000 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
shukiv/jabali-panel#2029 ·
维护者通常 1 天内回复
-
[submenu] nil issue on ubuntu 26.04可能已有人在做 @egoist 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复