Let gonsole bound an answer nobody reads
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with Timeouts and Env.Timeouts in gonsole, then NewServer in gonsole/serve.go (around lines 56-60), where WriteTimeout is never set. Read inflight.wrap (serve.go lines 198-204) and the open-request count in gonsole/idle.go (lines 40-46) to see why an unread answer keeps the server busy. Done means a test with an unread large answer lets the idle exit fire within 500 ms, and a zero Timeouts.Write leaves existing behaviour unchanged.
由索引模型根据 Issue 内容生成。
描述
Downstream applications that exit when idle must not be held up by a visitor who stops reading.
Current state: gonsole.Timeouts has no write field and NewServer never sets WriteTimeout (gonsole/serve.go:56-60), so gonsole bounds no write. A test on gonsole 0.8.0 asked for a large answer and never read it. The handler's writes stalled once the system's buffer filled. The request still counted as open (gonsole/idle.go:40-46), so a 100 ms idle exit had not come 2 seconds later. On a cancel, as on SIGTERM, ServeListening waited for Grace and CancelGrace and returned ErrStillServing.
Proposal: one of two bounds. First, a Timeouts.Write field that Env.Timeouts reads from HTTP_WRITE_TIMEOUT with AllowZero(), and NewServer copies into WriteTimeout. In the test, 500 ms let the idle exit come. It also cuts a long answer to a visitor who still reads. Second, inflight.wrap (gonsole/serve.go:198-204) hands the handler a writer that calls http.ResponseController.SetWriteDeadline before each write. In the test, even 1 s cut a visitor still reading, but 2 s did not. That writer must keep Flush, and its ReadFrom must move the deadline as it copies, or http.ServeContent gets one deadline for the whole file. Start from Timeouts.Write, because it is one field and zero changes nothing. Test it with an answer nobody reads.
Trigger: a downstream application serves downloads with IDLE_EXIT set.
- 主要语言
- Go
- 星标
- 69
- 派生
- 3
- 平均合并
- 9 小时 11 分钟
- 30 天内合并 PR
- 38
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
gopherium/framework 的其他 Issue
-
bug help wanted
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
enhancement help wanted
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
enhancement help wanted
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
enhancement help wanted
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
enhancement help wanted
难度 3/5 1-2 天 新手友好度 65/100
维护者通常 1 天内回复
查看 gopherium/framework 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
ClickHouse/ch-go#1218 ·
维护者通常 13 天内回复
-
automation models
难度 1/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 72/100
podman-container-tools/podman#30031 ·
维护者通常 1 天内回复