Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/crypto/ssh: TCP Forwarding Twice Hangs Second Connection #14598

Closed
theonewolf opened this issue Mar 2, 2016 · 1 comment
Closed

x/crypto/ssh: TCP Forwarding Twice Hangs Second Connection #14598

theonewolf opened this issue Mar 2, 2016 · 1 comment

Comments

@theonewolf
Copy link

@theonewolf theonewolf commented Mar 2, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?

    > go version
    go version go1.6 linux/amd64
  2. What operating system and processor architecture are you using (go env)?

    Ubuntu 14.04.4 LTS

    > go env
    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH="/home/wolf/goworkspace"
    GORACE=""
    GOROOT="/usr/local/go"
    GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
    GO15VENDOREXPERIMENT="1"
    CC="gcc"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
    CXX="g++"
    CGO_ENABLED="1"
  3. What did you do?
    (Use play.golang.org to provide a runnable example, if possible.)

    If I use Dial() on an SSH Client more than once, the second returned net.Conn can not read/write until the first Dial completes. The write's appear to work fine on the returned net.Conn, but aren't actually delivered until the first one is Close()d.

    Example:

            sshClient, err := ssh.Dial("tcp", serverstr, sshConfig)
            remoteConn, err := sshClient.Dial("tcp", remoteString)
            defer remoteConn.Close()
            remoteConn2, err := sshClient.Dial("tcp", remoteString)

    In this code, remoteConn2 will not send bytes until remoteConn is Close()d, and remoteConn2 will not Read() until remoteConn is closed.

  4. What did you expect to see?

    I expect every Dial()ed connection to be independent of the others and able to fully multiplex. I don't want to have to wait for previous Dial()ed connections to close.

    This greatly hinders throughput.

  5. What did you see instead?

    I must Close() previously Dial()ed connections if I want any new ones to work.

@theonewolf theonewolf changed the title x/crypto/ssh: Dialing Twice Hangs Second Connection x/crypto/ssh: TCP Forwarding Twice Hangs Second Connection Mar 2, 2016
@theonewolf
Copy link
Author

@theonewolf theonewolf commented Mar 2, 2016

This was with a single-threaded dev server, I believe that was the issue. But, the concurrent performance off ssh still seems a bit low.

@theonewolf theonewolf closed this Mar 2, 2016
@golang golang locked and limited conversation to collaborators Mar 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.