#1059 new defect

sshfs does not wait for an FX_CLOSE request to complete before reporting success from the close

Reported by: davidsarah Owned by:
Priority: major Milestone: undecided
Component: code-frontend-ftp-sftp Version: 1.6.1
Keywords: sftp sshfs preservation docs Cc:
Launchpad Bug:

Description (last modified by warner)

sshfs does not wait for 'close' requests on a file opened for writing to complete, before reporting to the application that a file has been successfully closed.

If the client attempts to reopen the same file via SFTP, we delay the open request until the previous upload has completed (successfully or not), so this does not normally cause visibly incorrect behaviour.

However, if the upload fails, sshfs has no way to report the failure (even though we do correctly return an error from the close request). So written data may be lost if the gateway is shut down, or there is a network error, lack of storage space on the grid, etc.

It is possible to patch sshfs to wait for the close reponse, but this may cause different problems, for example timeouts in applications along the same lines as #1041. Another possibility would be to store the written data at the gateway so that if it is shut down, it can restart the upload the next time it starts up (this is a variant on #935).

Attachments (1)

sshfs.c.patch (693 bytes) - added by davidsarah at 2010-05-28T22:45:25Z.
Patch to make sshfs wait for files to be uploaded when they are closed.

Download all attachments as: .zip

Change History (6)

Changed at 2010-05-28T22:45:25Z by davidsarah

Patch to make sshfs wait for files to be uploaded when they are closed.

comment:1 Changed at 2010-05-28T22:46:58Z by davidsarah

  • Description modified (diff)

comment:2 Changed at 2010-05-28T22:47:27Z by davidsarah

  • Keywords sshfs added

comment:3 Changed at 2010-05-30T04:59:18Z by zooko

Is this an issue we should report to http://fuse.sourceforge.net/sshfs.html ?

comment:4 Changed at 2014-12-02T19:42:55Z by warner

  • Component changed from code-frontend to code-frontend-ftp-sftp
  • Description modified (diff)

comment:5 Changed at 2017-02-05T17:47:31Z by warner

Note that a likely symptom of this bug (if the upload fails, perhaps because you do not have enough servers to meet the "shares of happiness" threshold), is that you wind up with zero-length files in your sshfs directory listing, which cannot be downloaded. I don't think these are tahoe-size entries: the SFTP frontend would report a 0-length file briefly (if you list the directory while uploading), but maybe sshfs frontends are caching the result and persisting in showing you a 0-length file even after tahoe has given up.

Note: See TracTickets for help on using tickets.