GNOME Bugzilla – Bug 796971
filesink: Implement workaround for some (network) filesystems that spuriously return EACCES on write
Last modified: 2018-11-03 12:47:36 UTC
See commit message
Created attachment 373355 [details] [review] filesink: Implement workaround for some (network) filesystems that spuriously return EACCES on write This seems to happen when another client is accessing the file at the same time, and retrying after a short amount of time solves it. Sometimes partial data is written at that point already but we have no idea how much it is, or if what was written is correct (it sometimes isn't) so we always first seek back to the current position and repeat the whole failed write. Between write attempts that failed with EACCES we wait 10ms, and after 1000 (10s) consecutive tries that failed with EACCES we simply give up. In theory a valid EACCES for files to which we simply have no access should've happened already during the call to open(), except for NFS (see open(2)). This can be enabled with the new retry-on-eacces boolean property, and a new o-sync boolean property was added to open the file in O_SYNC mode as without that it's not guaranteed that we get EACCES for the actual writev() call that failed but might only get it at a later time.
Review of attachment 373355 [details] [review]: That sounds like a workaround very specific to one filesystem? Can you specify which one it is so we can revert it once it's fixed? Are you sure you're not just hitting a kernel bug (and a slightly newer or older kernel would fix it)?
(In reply to Olivier Crête from comment #2) > Review of attachment 373355 [details] [review] [review]: > > That sounds like a workaround very specific to one filesystem? Can you > specify which one it is so we can revert it once it's fixed? Are you sure > you're not just hitting a kernel bug (and a slightly newer or older kernel > would fix it)? It happens on macOS and Linux, with SMB/CIFS and NFS. So seems more like a general problem unfortunately.
(In reply to Sebastian Dröge (slomo) from comment #3) > It happens on macOS and Linux, with SMB/CIFS and NFS. So seems more like a > general problem unfortunately. Oh can you add that in a comment then?
Sure, will do so when merging if it's otherwise accepted :)
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/305.