Comments (3)
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.
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.
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)
- Absolute file URLs on Windows HOT 5
- Zbox storage needs destroy method
- RepoInfo.uri() should not mask secretive data
- Is zbox secure agains storage file tampering? HOT 3
- Confusing abort if omit zbox::init_env HOT 7
- zbox::Error is not accessible from within std::io::Error HOT 1
- Stress-testing multiple reads, writes and seeks produces an unreadable file (IO error: File not found)
- Problems when `file://` storage runs out of space HOT 42
- Panic when writing to `Mutex<zbox::File>` from multiple threads. HOT 1
- Panic when trying to write a file after interrupted previous attempt. HOT 1
- FR: `zbox::Repo::ongoing_transaction` HOT 5
- Is zbox::Repo::rename atomic? HOT 1
- Add dedup file option when creating repo
- RepoInfo lack of dedup_file entry
- Snapshots? HOT 2
- Failed open repo in file mode
- Question: reason not support symbolic link?
- storage-sqlite RepoOpener not creating path
- Future plans and continuation HOT 1
- Python support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zbox.