8000 Deadlock if server kills the transfer · Issue #181 · pkg/sftp · GitHub < 8000 link rel="manifest" href="/manifest.json" crossOrigin="use-credentials">
[go: up one dir, main page]

Skip to content
Deadlock if server kills the transfer #181
@us3r64

Description

@us3r64

If the sftp server is killed on the server side looks to be a deadlock.
To reproduce this start downloading a big file and kill the running sftp-server on the server:

ps faux | grep "sftp-server"
kill -9 <pid>

This looks to happen in dispatchRequest and broadcastErr

goroutine 20 [chan send, 2 minutes]:
github.com/pkg/sftp.(*clientConn).dispatchRequest(0xc4200180c0, 0xc420018780, 0x1384cc0, 0xc42052e0c0)
	/Users/user64/gocode/src/github.com/pkg/sftp/conn.go:110 +0x1f3
github.com/pkg/sftp.(*File).WriteTo.func1(0xc42023c000, 0x8000, 0x8000, 0x868000)
	/Users/user64/gocode/src/github.com/pkg/sftp/client.go:771 +0x10d
github.com/pkg/sftp.(*File).WriteTo(0xc42001c660, 0x13837c0, 0x13c27a0, 0x31a00f0, 0xc42001c660, 0xc420063501)
	/Users/user64/gocode/src/github.com/pkg/sftp/client.go:781 +0xae8
io.copyBuffer(0x13837c0, 0x13c27a0, 0x1382940, 0xc42001c660, 0x0, 0x0, 0x0, 0xc420049ce0, 0xc420049cd8, 0xc4200143c0)
	/usr/local/opt/go/libexec/src/io/io.go:380 +0x31a
io.Copy(0x13837c0, 0x13c27a0, 0x1382940, 0xc42001c660, 0x0, 0x0, 0x554)
	/usr/local/opt/go/libexec/src/io/io.go:360 +0x68

goroutine 5 [chan send, 2 minutes]:
github.com/pkg/sftp.(*clientConn).broadcastErr(0xc4200180c0, 0x13828c0, 0xc420070020)
	/Users/user64/gocode/src/github.com/pkg/sftp/conn.go:123 +0x272
github.com/pkg/sftp.(*clientConn).loop(0xc4200180c0)
	/Users/user64/gocode/src/github.com/pkg/sftp/conn.go:51 +0x92
created by github.com/pkg/sftp.NewClientPipe
	/Users/user64/gocode/src/github.com/pkg/sftp/client.go:77 +0x20c

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0