Skip to content

[✨ Triage] dotnet/runtime#118906 by jozkee - 8.0: Http2_IncorrectServerPreface_RequestFailsWithAppropriateHttpProtoc ... #1400

@MihuBot

Description

@MihuBot

Triage for dotnet/runtime#118906.
Repo filter: All networking issues.
MihuBot version: c604a6.
Ping MihaZupan for any issues.

This is a test triage report generated by AI, aimed at helping the triage team quickly identify past issues/PRs that may be related.
Take any conclusions with a large grain of salt.

dotnet/runtime#118906: 8.0: Http2_IncorrectServerPreface_RequestFailsWithAppropriateHttpProtocolException failed by jozkee
[Tool] Searching for Http2_IncorrectServerPreface_RequestFailsWithAppropriateHttpProtocolException, HttpProtocolError Actual: Unknown, Http2 server preface failure, SocketsHttpHandlerTest_Http2 failure, Http2 IncorrectServerPreface (IncludeOpen=True, IncludeClosed=True, IncludeIssues=True, IncludePullRequests=True, Repository=dotnet/runtime)
[Tool] Found 58 issues, 60 comments, 55 returned results (13125 ms)

Here are related issues and discussions for issue #118906 ('8.0: Http2_IncorrectServerPreface_RequestFailsWithAppropriateHttpProtocolException failed'):


1. Issue #92647 (September 2023) - [Test Failure] Http2_IncorrectServerPreface_RequestFailsWithAppropriateHttpProtocolException

  • Summary: This issue documents a previous failure of the same test: System.Net.Http.Functional.Tests.SocketsHttpHandlerTest_Http2.Http2_IncorrectServerPreface_RequestFailsWithAppropriateHttpProtocolException. The error message and known issue validation process are nearly identical to #118906. The issue was closed after a known issue match and a test update.
  • Resolution: The test was made more deterministic (see PR #94112 below).

2. PR #94112 (October 2023) - make Http2_RequestFailsWithAppropriateHttpProtocolException test more deterministic

  • Summary: This PR directly addresses flakiness in the test by synchronizing the test logic to ensure the client request is processed after the server sends the GOAWAY frame. The PR notes that the test would sometimes fail with an "Unknown" error instead of the expected HttpProtocolException due to timing/race conditions, especially after connection pool refactoring.
  • Resolution: The test was updated to wait for the request to begin before sending the GOAWAY, which made the test deterministic and resolved the frequent failures.

3. Issue #82168 (February 2023) - HttpProtocolException is not reported properly on initial HTTP/2 settings handshake failure

  • Summary: This issue describes a bug where, if the server does not send a proper HTTP/2 SETTINGS preface (e.g., responds with GOAWAY), the thrown exception is not the expected HttpProtocolException. Instead, the protocol exception is wrapped deeper in the stack, making it hard to assert in tests.
  • Discussion: The triage comment notes this is a straightforward fix and should be addressed in .NET 8.0.
  • Relevance: This is the underlying cause for the test in #118906: the client is expected to throw HttpProtocolException when the server preface is incorrect, but sometimes it does not.

4. PR #71345 (June 2022) - Implement HttpProtocolException for HTTP/2

  • Summary: This PR implements the HttpProtocolException for HTTP/2, as part of the work to expose protocol errors to users and tests. It is a foundational change that enables the test in question to assert on protocol errors.
  • Discussion: The PR includes code and test suggestions for asserting HttpProtocolException as the inner exception of HttpRequestException.

5. Issue #29462 (May 2019) - Http2_DataSentBeforeServerPreface_ProtocolError - failed

  • Summary: This issue tracks failures in a related test (Http2_DataSentBeforeServerPreface_ProtocolError), where the expected protocol error is not observed, and instead, a generic or unrelated exception is thrown. The discussion highlights the inherent race conditions in HTTP/2 connection shutdown and error reporting.
  • Discussion: The comments discuss the need for consistent and meaningful exception handling for protocol errors, similar to the root cause of #118906.

6. Issue #30459 (August 2019) - Http2_DataSentBeforeServerPreface_ProtocolError failed in CI

  • Summary: Another instance of the test failing due to inconsistent exception reporting when the server preface is incorrect or missing. The discussion includes a detailed analysis of the retry logic and exception propagation in the HTTP/2 connection code.
  • Resolution: Fixes were made in .NET Core 3.0 and 5.0 to improve exception consistency.

7. Issue #70684 (June 2022) - [API Proposal]: Exposing HTTP/2 and HTTP/3 protocol error codes

  • Summary: This API proposal led to the introduction of HttpProtocolException and the public exposure of protocol error codes, which is directly relevant to the test's assertion logic in #118906.

8. Issue #82168 (February 2023) - HttpProtocolException is not reported properly on initial HTTP/2 settings handshake failure


Summary

  • The test in #118906 is a known source of flakiness due to race conditions in HTTP/2 connection error handling, especially when the server sends an incorrect preface (e.g., GOAWAY before SETTINGS).
  • The root cause was addressed by making the test more deterministic (PR #94112) and by improving exception reporting in the HTTP/2 stack (PR #71345, Issue #82168).
  • The specific error ("Expected: HttpProtocolError", "Actual: Unknown") is a known issue and has been previously validated as such.
  • The underlying infrastructure for protocol error reporting was introduced in .NET 8.0, and the test is expected to be stable after these changes.

If you are triaging #118906, you can safely reference the above issues (especially #92647, #82168, and PR #94112) as prior art and root cause analysis. The problem is well-understood, and the test has been improved to avoid this flakiness in recent versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions