[go] net/http/internal/http2: prevent alloc when writing status code for responses

2 views
Skip to first unread message

Nicholas Husin (Gerrit)

unread,
Apr 2, 2026, 8:32:30 AM (7 days ago) Apr 2
to goph...@pubsubhelper.golang.org, Go LUCI, Damien Neil, golang-co...@googlegroups.com
Attention needed from Damien Neil

Nicholas Husin voted and added 1 comment

Votes added by Nicholas Husin

Hold+1

1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Nicholas Husin . unresolved

Hold: do not submit until CL 762040 is vendored into `std`. Otherwise, we'll be adding allocs when writing `200` and `404` status codes compared to before, since they'll escape when being encoded.

Open in Gerrit

Related details

Attention is currently required from:
  • Damien Neil
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Holds
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I230bed1b83627c1fb389c0507106d8e16a6a6964
Gerrit-Change-Number: 762140
Gerrit-PatchSet: 1
Gerrit-Owner: Nicholas Husin <n...@golang.org>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Nicholas Husin <n...@golang.org>
Gerrit-Attention: Damien Neil <dn...@google.com>
Gerrit-Comment-Date: Thu, 02 Apr 2026 12:32:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Damien Neil (Gerrit)

unread,
Apr 2, 2026, 10:58:14 AM (7 days ago) Apr 2
to Nicholas Husin, goph...@pubsubhelper.golang.org, Go LUCI, golang-co...@googlegroups.com
Attention needed from Nicholas Husin

Damien Neil voted Code-Review+2

Code-Review+2
Open in Gerrit

Related details

Attention is currently required from:
  • Nicholas Husin
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Holds
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I230bed1b83627c1fb389c0507106d8e16a6a6964
Gerrit-Change-Number: 762140
Gerrit-PatchSet: 1
Gerrit-Owner: Nicholas Husin <n...@golang.org>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Nicholas Husin <n...@golang.org>
Gerrit-Attention: Nicholas Husin <n...@golang.org>
Gerrit-Comment-Date: Thu, 02 Apr 2026 14:58:10 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Nicholas Husin (Gerrit)

unread,
Apr 2, 2026, 2:03:55 PM (6 days ago) Apr 2
to Nicholas Husin, goph...@pubsubhelper.golang.org, Damien Neil, Go LUCI, golang-co...@googlegroups.com
Attention needed from Nicholas Husin

Nicholas Husin voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Nicholas Husin
Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Holds
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I230bed1b83627c1fb389c0507106d8e16a6a6964
    Gerrit-Change-Number: 762140
    Gerrit-PatchSet: 1
    Gerrit-Owner: Nicholas Husin <n...@golang.org>
    Gerrit-Reviewer: Damien Neil <dn...@google.com>
    Gerrit-Reviewer: Nicholas Husin <hu...@google.com>
    Gerrit-Reviewer: Nicholas Husin <n...@golang.org>
    Gerrit-Attention: Nicholas Husin <n...@golang.org>
    Gerrit-Comment-Date: Thu, 02 Apr 2026 18:03:51 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Nicholas Husin (Gerrit)

    unread,
    Apr 8, 2026, 5:09:40 PM (7 hours ago) Apr 8
    to goph...@pubsubhelper.golang.org, Nicholas Husin, Damien Neil, Go LUCI, golang-co...@googlegroups.com

    Nicholas Husin voted and added 1 comment

    Votes added by Nicholas Husin

    Hold+0

    1 comment

    Patchset-level comments
    Nicholas Husin . resolved

    Hold: do not submit until CL 762040 is vendored into `std`. Otherwise, we'll be adding allocs when writing `200` and `404` status codes compared to before, since they'll escape when being encoded.

    Nicholas Husin

    CL 762040 has been vendored into `std` by CL 740121.

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I230bed1b83627c1fb389c0507106d8e16a6a6964
    Gerrit-Change-Number: 762140
    Gerrit-PatchSet: 1
    Gerrit-Owner: Nicholas Husin <n...@golang.org>
    Gerrit-Reviewer: Damien Neil <dn...@google.com>
    Gerrit-Reviewer: Nicholas Husin <hu...@google.com>
    Gerrit-Reviewer: Nicholas Husin <n...@golang.org>
    Gerrit-Comment-Date: Wed, 08 Apr 2026 21:09:36 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Nicholas Husin <n...@golang.org>
    satisfied_requirement
    open
    diffy

    Nicholas Husin (Gerrit)

    unread,
    Apr 8, 2026, 5:09:54 PM (7 hours ago) Apr 8
    to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Nicholas Husin, Damien Neil, Go LUCI, golang-co...@googlegroups.com

    Nicholas Husin submitted the change

    Change information

    Commit message:
    net/http/internal/http2: prevent alloc when writing status code for responses

    Previously, writing responses with non-200 and non-404 status code
    requires an allocation. Now that CL 762040 prevents header names and
    values from escaping, we can modify writeFrame to not allocate status
    codes on the heap.
    Change-Id: I230bed1b83627c1fb389c0507106d8e16a6a6964
    Reviewed-by: Nicholas Husin <hu...@google.com>
    Reviewed-by: Damien Neil <dn...@google.com>
    Files:
    • M src/net/http/internal/http2/http2.go
    • M src/net/http/internal/http2/write.go
    Change size: S
    Delta: 2 files changed, 5 insertions(+), 13 deletions(-)
    Branch: refs/heads/master
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Nicholas Husin, +2 by Damien Neil
    • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I230bed1b83627c1fb389c0507106d8e16a6a6964
    Gerrit-Change-Number: 762140
    Gerrit-PatchSet: 2
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages