Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Set cachable to false - #60

#60
Open
benrutter wants to merge 2 commits into
fsspec:mainfsspec/sshfs:mainfrom
benrutter:mainbenrutter/sshfs:mainCopy head branch name to clipboard
Open

Set cachable to false#60
benrutter wants to merge 2 commits into
fsspec:mainfsspec/sshfs:mainfrom
benrutter:mainbenrutter/sshfs:mainCopy head branch name to clipboard

Conversation

@benrutter

Copy link
Copy Markdown
Contributor

Closes issue #42

At the moment, because SSHFS is considered cachable, creating a new filesystem doesn't create a new connection, and maintains the old one.

That's probably not a good fit for SFTP connections, since they're likely to timeout and be closed off after a while, so almost any long running process using SSHFS is eventually going to hit an issue where the filesystem continues to reference a closed off connection, and the cache needs to be manually cleared.

To fix that, I've just set "cachable" to False here, so that creating a new filesystem would also bring in a new connection.

Honestly, I don't have the knowledge to know the full implications of this, but my main thoughts are:

  • Does this mean it's worth adding in something to clean up / close the connection when the SSHFS object goes out of memory? (otherwise there are potentially open but unusable connections floating around)
  • Is there a case where you'd want it to be cachable? In which case, the "cachable" setting could theoretically be put behind an __init__ argument? (my guess is that'd cause some kind of side effects nobody is expecting though)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.