Coder Social home page Coder Social logo

Comments (6)

jacobsa avatar jacobsa commented on August 12, 2024

So what to do about this? Some options:

  • Do nothing. Don't make the "writes before flushes" guarantee to the file system implementer. This sucks, let's not do it.
  • Process all requests serially. This is nice and simple, but could be very slow.
  • Set up a barrier: wait for responses to all write requests for a given handle to complete before passing on a flush for that handle, potentially blocking the pipeline behind. Document this publicly.
  • Change the API so we don't call blocking functions but rather just pass on requests, either as a channel or a read method or asynchronous function calls.

from fuse.

jacobsa avatar jacobsa commented on August 12, 2024

This can be made very easy to reproduce by sticking a time.Sleep(time.Second) at the top of the bazilfuse.WriteRequest case in server.go. It makes FlushFSTest.Mmap_MunmapBeforeClose fail every time.

The same is not true of FlushFSTest.CloseReports_ReadWrite, where it appears that each write(2) call is blocking on the fuse write request to finish. This surprises me; I thought writes were supposed to happen asynchronously via the page cache.

from fuse.

jacobsa avatar jacobsa commented on August 12, 2024

Closing the loop: I think perhaps the reason that we wait for write(2) is because we don't respond to Init with bazilfuse.InitWritebackCache, corresponding to FUSE_WRITEBACK_CACHE in fuse_kernel.h. This was apparently added in kernel 3.15, so I can't verify on my 3.13 machine.

from fuse.

jacobsa avatar jacobsa commented on August 12, 2024

Current favored solution:

  • Kill the FileSystem interface.
  • Instead, have an Op interface with methods Context() context.Context and Respond(error).
  • Concrete implementations are structs with both request and response fields.
  • Take this opportunity to put them in a fuseops sub-package. For example, fuseops.ReadOp.
  • Have a Connection type that exposes a read method for a stream of Ops, directly reflecting /dev/fuse.
  • Move existing method and struct comments onto the op structs.
  • Mount function accepts serveConn func(*Connection).
  • Kill MountedFileSystem.WaitForReady; instead just in Mount (and document this).
  • Audit package and README comments, update where necessary.

from fuse.

jacobsa avatar jacobsa commented on August 12, 2024

This is blocked by #4; we want tests that we can run many times to confirm we've fixed the issue.

from fuse.

jacobsa avatar jacobsa commented on August 12, 2024

All done with 336525b.

from fuse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.