Open
Description
请先确认以下事项:
问题描述
Line 222 in 9ac929a
这一行设置的 res.WriteHeader(http.StatusOK)
是多余的
不知道是不是这个原因,今天看到 rainbond-api 占用了30G内存
该问题是否可以稳定重现?
可重现
重现步骤
最新版本有这个报错日志
截图
日志
2025-04-27T05:58:24.570752250Z INFO[2025/04/27 13:58:24] ip=10.42.0.55 module=rbd-api Fetching logs for container
89
2025-04-27T05:58:24.708715118Z 2025/04/27 13:58:24 http: superfluous response.WriteHeader call from github.com/goodrain/rainbond/api/server.(*Manager).Run.func4.1 (api.go:222)
90
2025-04-27T05:58:34.708773202Z 2025/04/27 13:58:34 http: superfluous response.WriteHeader call from github.com/goodrain/rainbond/api/server.(*Manager).Run.func4.1 (api.go:222)
91
2025-04-27T05:58:44.708795073Z 2025/04/27 13:58:44 http: superfluous response.WriteHeader call from github.com/goodrain/rainbond/api/server.(*Manager).Run.func4.1 (api.go:222)
92
2025-04-27T05:58:54.708865178Z 2025/04/27 13:58:54 http: superfluous response.WriteHeader call from github.com/goodrain/rainbond/api/server.(*Manager).Run.func4.1 (api.go:222)
93
2025-04-27T05:59:04.709237696Z 2025/04/27 13:59:04 http: superfluous response.WriteHeader call from github.com/goodrain/rainbond/api/server.(*Manager).Run.func4.1 (api.go:222)
94
2025-04-27T05:59:14.709292351Z 2025/04/27 13:59:14 http: superfluous response.WriteHeader call from github.com/goodrain/rainbond/api/server.(*Manager).Run.func4.1 (api.go:222)
95
2025-04-27T05:59:24.709494604Z 2025/04/27 13:59:24 http: superfluous response.WriteHeader call from github.com/goodrain/rainbond/api/server.(*Manager).Run.func4.1 (api.go:222)
96
2025-04-27T05:59:34.709244937Z 2025/04/27 13:59:34 http: superfluous response.WriteHeader call from github.com/goodrain/rainbond/api/server.(*Manager).Run.func4.1 (api.go:222)
97
2025-04-27T05:59:44.708983228Z 2025/04/27 13:59:44 http: superfluous response.WriteHeader call from github.com/goodrain/rainbond/api/server.(*Manager).Run.func4.1 (api.go:222)
98
2025-04-27T05:59:54.709411121Z 2025/04/27 13:59:54 http: superfluous response.WriteHeader call from github.com/goodrain/rainbond/api/server.(*Manager).Run.func4.1 (api.go:222)
99
2025-04-27T06:00:00.288462618Z INFO[2025/04/27 14:00:00] ip=10.42.0.55 module=rbd-api Fetching logs for container
100
2025-04-27T06:00:00.544797204Z INFO[2025/04/27 14:00:00] ip=10.42.0.55 module=rbd-api Fetching logs for container
期望结果
正常不报错
解决方案(可选)
移除多余的 WriteHeader 调用(Write 会自动发送 200)
操作系统 && Rainbond 版本
Ubuntu22 v6.2.1-release-9ac929a-2025-04-16-17
是否愿意提交 PR 解决该问题?
- 我愿意提交 PR 来解决该问题