Skip to content

Preserve unexpected errors in the remote command stream #2286

Backlog

Description

@skevetter

Finding

In pkg/platform/remotecommand/stream.go, Stream.Write breaks to a nil result both when a WebSocket read fails unexpectedly and when io.Copy fails writing received data. The nilerr baseline on ade0dc178682e7658ef465322d10bf42eae302b2 flags both paths. The code discards these errors; no production incident has been reproduced.

Scope and acceptance

Trace current callers first; verify a live supported entry point actually depends on this result. Use synthetic inputs and a failing local writer to prove the unexpected write error is observable rather than reported as success. Distinguish an unexpected read failure from an expected close frame, cancellation, or normal disconnect. Preserve protocol close behavior, the nil-writer case, and command exit handling. If the method is unused or the caller's error contract is ambiguous, document that evidence instead of changing semantics. Add focused tests before any signed draft PR. Keep repo-wide lint enforcement and unrelated cleanup out of scope.

Call-path check at ade0dc17

The only in-repo NewStream call uses Read(stdin), not Write. The supported exec client's output dispatcher already returns stdout/stderr write failures to its caller. Treat the lint findings as an unused/exported helper question, not a confirmed defect in the shipped exec path. Before changing behavior, confirm whether Stream.Write has any supported external caller; if none, recommend a small follow-up or no change rather than rewriting the working dispatch path.

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