Skip to content

feat: bump go to 1.27 with http2legacy build tag - #22391

Draft
aelnahas wants to merge 17 commits into
elastic:mainfrom
aelnahas:feat/go1.27-http2legacy
Draft

aelnahas wants to merge 17 commits into
elastic:mainfrom
aelnahas:feat/go1.27-http2legacy

Conversation

@aelnahas

@aelnahas aelnahas commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Motivation/summary

Experiment branched off #21721 to check whether the http2legacy build tag unblocks the Go 1.27 upgrade.

Go 1.27 moved the HTTP/2 implementation into net/http. With x/net >= v0.55.0, http2.ConfigureServer registers that internal implementation and net/http serves h2 connections itself, never calling the TLSNextProto handler gmux relies on to multiplex gRPC and HTTP/2. That is the cause of the TestHTTP2OverTLSFramingConsistency failure tracked in #21924.

Building with -tags http2legacy selects x/net's original implementation, which registers TLSNextProto["h2"], so net/http takes its retained legacy ALPN path and gmux works unchanged. This PR appends the tag to DEFAULT_TAGS in the Makefile, which flows into every build, test, and system-test target.

This is a stopgap: x/net only backports critical and security fixes to the legacy implementation. The durable fix is in gmux.

How to test these changes

CI system tests, in particular TestHTTP2OverTLSFramingConsistency and the gRPC/OTLP system tests.

Related issues

🤖 Generated with Claude Code

kruskall and others added 16 commits August 24, 2026 06:46
On Go 1.27, golang.org/x/net/http2 defaults to a wrapping implementation that hands HTTP/2 serving to net/http's internal server. net/http then serves h2 connections itself and never invokes the TLSNextProto handler gmux installs to sniff gRPC vs HTTP/2 traffic, which breaks gRPC routing and fails TestHTTP2OverTLSFramingConsistency. The http2legacy build tag selects x/net's original implementation, which registers TLSNextProto[h2] so net/http takes its legacy ALPN path and gmux keeps working as on Go 1.26.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@mergify

mergify Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

This pull request does not have a backport label. Could you fix it @aelnahas? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8.19 is the label to automatically backport to the 8.19 branch.
  • backport-9./d is the label to automatically backport to the 9./d branch. /d is the digit.
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@mergify

mergify Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

This pull request is now in conflicts. Could you fix it @aelnahas? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feat/go1.27-http2legacy upstream/feat/go1.27-http2legacy
git merge upstream/main
git push upstream feat/go1.27-http2legacy

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants