Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Let gonsole bound an answer nobody reads

オープン
#94 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go
領域
backend

調査の方向性

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 の本文から書いたものです。

説明

enhancement help wanted

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分
マージ済み PR(30日)
38

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

gopherium/framework のほかの issue

gopherium/framework の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。