Skip to content

Fix HTTP/2 SETTINGS mismatch connection failure in gmux - #20908

Merged
carsonip merged 4 commits into
elastic:mainfrom
carsonip:bump-gmux
Apr 16, 2026
Merged

carsonip merged 4 commits into
elastic:mainfrom
carsonip:bump-gmux

Conversation

@carsonip

@carsonip carsonip commented Apr 16, 2026 •

Copy link
Copy Markdown
Member

Motivation/summary

apm-server currently vendors a gmux version that can trigger HTTP/2 connection failures with strict clients after ALPN negotiates h2 (for example, curl/nghttp2 reporting framing/peer-close errors). The root problem is a SETTINGS mismatch sequence introduced by golang.org/x/net/http2 starting at v0.50.0 when multiplexers emit an initial sniffing SETTINGS frame before handing off to http2.Server.

This PR bumps gmux to the fix from elastic/gmux#97, which makes gmux mirror the backend http2.Server initial SETTINGS (instead of sending an empty sniffing SETTINGS), avoiding illegal SETTINGS value changes on the same connection. That restores HTTP/2 interoperability for affected clients while keeping gmux behavior resilient to backend initial-settings changes.

Before:

=== RUN   TestHTTP2OverTLSFramingConsistency
    http2_test.go:99: 
        	Error Trace:	/home/carson/projects/apm-server/systemtest/http2_test.go:99
        	Error:      	Not equal: 
        	            	expected: []http2.Setting(nil)
        	            	actual  : []http2.Setting{http2.Setting{ID:0x5, Val:0x100000}, http2.Setting{ID:0x3, Val:0xfa}, http2.Setting{ID:0x6, Val:0x100140}, http2.Setting{ID:0x1, Val:0x1000}, http2.Setting{ID:0x4, Val:0x100000}, http2.Setting{ID:0x9, Val:0x1}}
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1,2 +1,27 @@
        	            	-([]http2.Setting) <nil>
        	            	+([]http2.Setting) (len=6) {
        	            	+ (http2.Setting) {
        	            	+  ID: (http2.SettingID) 5,
        	            	+  Val: (uint32) 1048576
        	            	+ },
        	            	+ (http2.Setting) {
        	            	+  ID: (http2.SettingID) 3,
        	            	+  Val: (uint32) 250
        	            	+ },
        	            	+ (http2.Setting) {
        	            	+  ID: (http2.SettingID) 6,
        	            	+  Val: (uint32) 1048896
        	            	+ },
        	            	+ (http2.Setting) {
        	            	+  ID: (http2.SettingID) 1,
        	            	+  Val: (uint32) 4096
        	            	+ },
        	            	+ (http2.Setting) {
        	            	+  ID: (http2.SettingID) 4,
        	            	+  Val: (uint32) 1048576
        	            	+ },
        	            	+ (http2.Setting) {
        	            	+  ID: (http2.SettingID) 9,
        	            	+  Val: (uint32) 1
        	            	+ }
        	            	+}
        	            	 
        	Test:       	TestHTTP2OverTLSFramingConsistency
        	Messages:   	non-ACK SETTINGS #2 differs from first SETTINGS frame
    server.go:144: log file: /home/carson/projects/apm-server/systemtest/logs/TestHTTP2OverTLSFramingConsistency/apm-server
--- FAIL: TestHTTP2OverTLSFramingConsistency (10.03s)

After:

=== RUN   TestHTTP2OverTLSFramingConsistency
--- PASS: TestHTTP2OverTLSFramingConsistency (10.03s)

Checklist

  • Update CHANGELOG.asciidoc
    • Proposed bugfix release-notes entry for docs/release-notes/index.md:

Fixed an HTTP/2 SETTINGS mismatch in gmux that could cause strict HTTP/2 clients (for example, curl/nghttp2) to fail connections after ALPN negotiates h2.

For functional changes, consider:

  • Is it observable through the addition of either logging or metrics?
  • Is its use being published in telemetry to enable product improvement?
  • Have system tests been added to avoid regression?

How to test these changes

See new system test

Related issues

Fixes #20887

@github-actions

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

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

@carsonip carsonip added backport-active-9 Automated backport with mergify to all the active 9.[0-9]+ branches backport-active-8 Automated backport with mergify to all the active 8.[0-9]+ branches labels Apr 16, 2026
@carsonip carsonip changed the title Bump gmux to fix http2 settings frame error build(deps): bump gmux to fix HTTP/2 SETTINGS mismatch Apr 16, 2026
@carsonip carsonip changed the title build(deps): bump gmux to fix HTTP/2 SETTINGS mismatch Bump gmux to fix HTTP/2 SETTINGS mismatch Apr 16, 2026
@carsonip carsonip changed the title Bump gmux to fix HTTP/2 SETTINGS mismatch Fix HTTP/2 SETTINGS mismatch, bump gmux Apr 16, 2026
@carsonip carsonip changed the title Fix HTTP/2 SETTINGS mismatch, bump gmux Fix HTTP/2 SETTINGS mismatch connection failure Apr 16, 2026
@carsonip carsonip changed the title Fix HTTP/2 SETTINGS mismatch connection failure Fix HTTP/2 SETTINGS mismatch connection failure in gmux Apr 16, 2026
@carsonip
carsonip marked this pull request as ready for review April 16, 2026 16:58
@carsonip
carsonip requested a review from a team as a code owner April 16, 2026 16:58
@mergify

mergify Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

This pull request does not have a backport label. Could you fix it @carsonip? 🙏
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.

@elasticmachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@carsonip
carsonip added this pull request to the merge queue Apr 16, 2026
Merged via the queue into elastic:main with commit bbaaf9c Apr 16, 2026
18 checks passed
@carsonip
carsonip deleted the bump-gmux branch April 16, 2026 17:54
@github-actions

Copy link
Copy Markdown
Contributor

@Mergifyio backport 8.19 9.3 9.4

@mergify

mergify Bot commented Apr 16, 2026 •

Copy link
Copy Markdown
Contributor

backport 8.19 9.3 9.4

✅ Backports have been created

Details

Cherry-pick of bbaaf9c has failed:

On branch mergify/bp/8.19/pr-20908
Your branch is up to date with 'origin/8.19'.

You are currently cherry-picking commit bbaaf9ce.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   NOTICE-fips.txt
	modified:   NOTICE.txt
	modified:   go.mod
	new file:   systemtest/http2_test.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   go.sum

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Cherry-pick of bbaaf9c has failed:

On branch mergify/bp/9.3/pr-20908
Your branch is up to date with 'origin/9.3'.

You are currently cherry-picking commit bbaaf9ce.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   NOTICE-fips.txt
	modified:   NOTICE.txt
	modified:   go.mod
	new file:   systemtest/http2_test.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   go.sum

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@v1v

v1v commented Apr 16, 2026

Copy link
Copy Markdown
Member

@Mergifyio backport 8.19 9.3 9.4

@v1v

v1v commented Apr 16, 2026

Copy link
Copy Markdown
Member

@Mergifyio backport 9.4

@mergify

mergify Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

backport 8.19 9.3 9.4

☑️ Command backport 8.19 9.3 9.4 ignored because it is already running from a previous command.

@mergify

mergify Bot commented Apr 16, 2026 •

Copy link
Copy Markdown
Contributor

backport 9.4

✅ Backports have been created

Details

mergify Bot pushed a commit that referenced this pull request Apr 16, 2026
* Bump gmux to fix http2 settings frame error

* make notice

* Add http2_test.go

* make check-full

(cherry picked from commit bbaaf9c)

# Conflicts:
#	go.sum
mergify Bot pushed a commit that referenced this pull request Apr 16, 2026
* Bump gmux to fix http2 settings frame error

* make notice

* Add http2_test.go

* make check-full

(cherry picked from commit bbaaf9c)

# Conflicts:
#	go.sum
mergify Bot pushed a commit that referenced this pull request Apr 16, 2026
* Bump gmux to fix http2 settings frame error

* make notice

* Add http2_test.go

* make check-full

(cherry picked from commit bbaaf9c)
mergify Bot pushed a commit that referenced this pull request Apr 16, 2026
* Bump gmux to fix http2 settings frame error

* make notice

* Add http2_test.go

* make check-full

(cherry picked from commit bbaaf9c)
mergify Bot added a commit that referenced this pull request Apr 16, 2026
)

* Bump gmux to fix http2 settings frame error

* make notice

* Add http2_test.go

* make check-full

(cherry picked from commit bbaaf9c)

Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>
mergify Bot added a commit that referenced this pull request Apr 16, 2026
…re in gmux (#20913)

* Fix HTTP/2 SETTINGS mismatch connection failure in gmux (#20908)

* Bump gmux to fix http2 settings frame error

* make notice

* Add http2_test.go

* make check-full

(cherry picked from commit bbaaf9c)

# Conflicts:
#	go.sum

* Fix conflict

---------

Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>
Co-authored-by: Carson Ip <carson.ip@elastic.co>
mergify Bot added a commit that referenced this pull request Apr 16, 2026
…ure in gmux (#20912)

* Fix HTTP/2 SETTINGS mismatch connection failure in gmux (#20908)

* Bump gmux to fix http2 settings frame error

* make notice

* Add http2_test.go

* make check-full

(cherry picked from commit bbaaf9c)

# Conflicts:
#	go.sum

* Fix conflict

---------

Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>
Co-authored-by: Carson Ip <carson.ip@elastic.co>
This was referenced Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-8 Automated backport with mergify to all the active 8.[0-9]+ branches backport-active-9 Automated backport with mergify to all the active 9.[0-9]+ branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTTP/2 connection error from 8.19.12, 9.2.6, 9.3.1

4 participants