Skip to content

Port-forward stays active after workspace stop/restart, causing dead forward and timeouts #19269

@blink-so

Description

@blink-so

coder port-forward remains running after the workspace is stopped or restarted. The local listener stays open but the tunnel is dead, so client connections hang/time out.

Expected behavior

  • Either:
    • The port-forward session exits when the workspace stops/restarts; or
    • The port-forward window logs workspace lifecycle events (start/stop/restart) so the user knows what to expect.

Actual behavior

  • The CLI keeps printing "Forwarding ... Ready!" and stays active. After the workspace is stopped/restarted, connections to the forwarded local port hang/time out, with no additional logs in the port-forward session.

Steps to reproduce

  1. Run: coder port-forward <workspace> --tcp 5900:5900
  2. Stop/restart the workspace
  3. Attempt to connect to localhost:5900
  4. Observe timeouts; the port-forward session does not indicate the workspace stopped or that the tunnel is broken
Image

Issue by @phorcys420

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions