Skip to content

[PureGo] rawStream handshake masks server DeadlineExceeded as teardown artifact #644

Description

@zlata-stefanovic-db

Summary

rawStream.handshake currently treats gRPC codes.DeadlineExceeded as a teardown artifact in isTeardownArtifact, which is too broad for the current Conn.Open path.

Because streamCtx is created with context.WithoutCancel(...) + context.WithCancel(...), teardown cancels the RPC context but does not set a deadline. A teardown-provoked gRPC outcome should therefore be codes.Canceled on this path; codes.DeadlineExceeded can represent a real server status.

Impact

When hctx has expired, handshake prefers hctx.Err() over any error classified as teardown artifact. With the current classifier, a genuine server codes.DeadlineExceeded can be dropped and replaced by context.DeadlineExceeded, changing how downstream logic classifies/retries the failure.

Proposed fix

Narrow the gRPC teardown-artifact classification to codes.Canceled (while keeping bare-context and EOF checks for non-gRPC implementations).

Test gap / follow-up

Add coverage that exercises a server status.Error(codes.DeadlineExceeded, ...) in the handshake-timeout arbitration path and asserts that the server status is preserved (not replaced by hctx.Err()).

Context

Raised during review of PR #636 as a preexisting, out-of-scope issue.

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