Opened at 2010-05-28T22:42:46Z
Last modified at 2017-02-05T17:47:31Z
#1059 new defect
sshfs does not wait for an FX_CLOSE request to complete before reporting success from the close — at Initial Version
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
sshfs does not wait for 'close' requests 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).
Patch to make sshfs wait for files to be uploaded when they are closed.