Skip to content

Graceful shutdown (GOAWAY NO_ERROR) currently surfaces as TransportConnectionException #1913

@aki1770-del

Description

@aki1770-del

Core Request: Consider exposing a graceful shutdown (GOAWAY with NO_ERROR) in a form that callers can distinguish from a forceful close.

Current Implementation: In pkgs/http2/lib/src/connection.dart, _terminate() is the only site for constructing TransportConnectionException, and it hardcodes "Connection is being forcefully terminated" regardless of whether the cause was a peer GOAWAY-NO_ERROR or an actual fault. This issue (#1364 open since 2019) and #1380 track the same surface from different angles.

Context: We initially tried to map errorCode == 0 at the gRPC layer (grpc/grpc-dart#827), but the maintainer correctly pointed out it's the wrong layer.

Proposed Shapes: In order of least disruptive:

a. A TransportConnectionException subtype constructed when errorCode == NO_ERROR.
b. Completing connection.done cleanly (without exception) on graceful close, which would be breaking but cleaner.
c. Some other shape entirely - RFC 7540 §6.8 leaves room for distinguishing graceful shutdown from error.

Migration Shape: The package's call. Happy to defer if there's a different priority.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions