C2FO / vfs

Pluggable, extensible virtual file system for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sftp backend never closes open sftp connections

funkyshu opened this issue · comments

In a log lived application, when a vfs sftp backend filesystem falls out of scope, it doesn't disconnect the underlying ssh connection to remote server. The connections are only severed by restarting the either the calling application or the sftp server.

As a user of the vfs library, I expect that once I've completed my SFTP operations, I have a way to disconnect my ssh connection to the server.

We should ensure that:

  1. A user has a way to explicitly disconnect the connection from a sftp backed to a server
  2. sftp backend auto-disconnects after 10 seconds of disuse. This value should be configurable via options.