commit | 737aa1dc61e93af5e18282c7bc6e34e22ee7dfa6 | [log] [tgz] |
---|---|---|
author | John Eikenberry <jae@zhar.net> | Thu Jun 29 11:27:52 2017 -0700 |
committer | John Eikenberry <jae@zhar.net> | Thu Jun 29 11:27:52 2017 -0700 |
tree | ee701ad59802e802e1135e1be1c798c779dbcaf4 | |
parent | ca043ca452cac768d3b7bab7140076218dad0445 [diff] |
Fixes #181: client deadlock on server death The client was deadlocking if you killed the server when a file transfer was occuring. The problem occured when you had many requests sent and were waiting on responses when the server dies. The errors for all those pending requests get sent along the response channel which is also used for the errors reported by the new requests being made. The new request channel send is in the same loop as the channel reading, so when it blocked due to all other errors filling the channel it deadlocked the program. There were 2 possible fixes, changing the new request error channel usage to be in a separate goroutine to keep it from blocking the loop or to increase the size of the buffer to handle all the errors. This implements the latter. Included is a test that reproduces the problem most of the time. Due to the required timing of the issue, it was impossible to reproduce 100% of the time.
The sftp
package provides support for file system operations on remote ssh servers using the SFTP subsystem. It also implements an SFTP server for serving files from the filesystem.
See godoc.org/github.com/pkg/sftp for examples and usage.
The basic operation of the package mirrors the facilities of the os package.
The Walker interface for directory traversal is heavily inspired by Keith Rarick's fs package.
We welcome pull requests, bug fixes and issue reports.
Before proposing a large change, first please discuss your change by raising an issue.
For API/code bugs, please include a small, self contained code example to reproduce the issue. For pull requests, remember test coverage.
We try to handle issues and pull requests with a 0 open philosophy. That means we will try to address the submission as soon as possible and will work toward a resolution. If progress can no longer be made (eg. unreproducible bug) or stops (eg. unresponsive submitter), we will close the bug.
Thanks.