Skip to content

Make HTTP Client manual reopen generation-safe #190

Description

@kentbull

Problem

Client.reopen() currently replaces the connector and response parser even when a request is still awaiting its response. That silently abandons the active exchange. When reopen is otherwise legal, the connector also retains its receive buffer, allowing bytes accepted from the old socket to enter the fresh parser generation.

Expected behavior

  • Raise RuntimeError when manual reopen would discard an unsettled response generation.
  • Leave the active socket, parser, queued request bytes, and waiting state unchanged after rejection.
  • On a legal reopen, clear residual old-generation receive bytes before rearming the response parser.

Upstream dependency

This changes a public method contract and is not ready for current main. It depends on #189 and its prerequisite chain through #188 and PRs #183, #185, and #187. The release branch already contains those changes.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions