Code Monkey home page Code Monkey logo

Comments (3)

burmecia avatar burmecia commented on September 20, 2024

Keep watching on ZboxFS data folder is not good idea, you probably only need to watch source code change. For example, using below command will only watch src, tests and examples folder.

cargo watch -w src -w tests -w examples -x 'run --example zbox_demo --features storage-file -- --nocapture'

Another option is, If you're really sure what you're doing, you can break the exclusive repo access promise by using force option, which will open repo regardless lock file. But be cautious because this can potentially corrupt your repo data.

RepoOpener::new().force(true).open("file://your_repo", "pwd").unwrap();

Documentation for force option is here: https://docs.rs/zbox/0.8.7/zbox/struct.RepoOpener.html#method.force

from zbox.

theduke avatar theduke commented on September 20, 2024

You missed this line:

(of course watch should ignore the data directory in real use, but this demonstrates a problem)

I just stumbled over this before adding a --ignore flag.
The point was this could occur in real live when the application crashes.

I didn't see the force option though.

I have implemented a pid lockfile , but this would be helpful to include out of the box.

from zbox.

burmecia avatar burmecia commented on September 20, 2024

Sorry I missed that line.

I think there is a case when using lock file regardless it contains pid or not. For an example, process A opened a repo and it crashed with lock file undeleted, and another process B started and it sees the pid lock file is different. How process B deal with this situation? If process B forcefully delete that pid file to clear the lock, how it distinguishes the case if process A is still running?

So the trade-off is to use force option, it can open repo regardless the lock but at the cost there might be chances data get corrupted.

from zbox.

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.