Add lockfile for control of UserCouch.basedir
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
UserCouch |
Fix Released
|
High
|
Jason Gerard DeRose |
Bug Description
CouchDB has a rather unfortunate behavior in that multiple instances will happily start using the exact same database and view files. As CouchDB doesn't do any kind of sane locking, UserCouch really should.
This will also help making the development process nicer. As multiple processes can bind to org.freedesktop
So I'm adding a simple lock using fcntl.flock(). Although not portable, it's reliable and easy to work with.
Something still to work out is how this lock is going to behave with regard to beam not actually terminating when the user logs out. desktopcouch had this problem too (and AFAIK, they never came up with a solution).
Related branches
- David Jordan: Approve
-
Diff: 144 lines (+81/-5)2 files modifiedusercouch/__init__.py (+22/-5)
usercouch/tests/__init__.py (+59/-0)
Changed in usercouch: | |
status: | In Progress → Fix Committed |
Changed in usercouch: | |
status: | Fix Committed → Fix Released |