Skip to content

[9.4] (backport #20908) Fix HTTP/2 SETTINGS mismatch connection failure in gmux - #20915

Merged
mergify[bot] merged 1 commit into
9.4from
mergify/bp/9.4/pr-20908
Apr 16, 2026
Merged

mergify[bot] merged 1 commit into
9.4from
mergify/bp/9.4/pr-20908

Conversation

@mergify

@mergify mergify Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

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


This is an automatic backport of pull request #20908 done by [Mergify](https://mergify.com).

* Bump gmux to fix http2 settings frame error

* make notice

* Add http2_test.go

* make check-full

(cherry picked from commit bbaaf9c)
@mergify mergify Bot added the backport label Apr 16, 2026
@mergify
mergify Bot requested a review from a team as a code owner April 16, 2026 21:42
@mergify mergify Bot added the backport label Apr 16, 2026
@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!)

@mergify mergify Bot added the queued label Apr 16, 2026
@mergify

mergify Bot commented Apr 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Merge Queue Status

This pull request spent 15 minutes 31 seconds in the queue, including 15 minutes 14 seconds running CI.

Required conditions to merge

mergify Bot added a commit that referenced this pull request Apr 16, 2026
@elasticmachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

cc @carsonip

@mergify
mergify Bot merged commit f8d4b08 into 9.4 Apr 16, 2026
22 checks passed
@mergify
mergify Bot deleted the mergify/bp/9.4/pr-20908 branch April 16, 2026 22:13
@mergify mergify Bot removed the queued label Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants