Add lockfile for control of UserCouch.basedir

Bug #1024711 reported by Jason Gerard DeRose
6
This bug affects 1 person
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.Dmedia, often you'll mistakenly have both the system-wide Dmedia running and dmedia-service running from inside the source tree. Some simple locking will help prevent possible screwy behavior.

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

Changed in usercouch:
status: In Progress → Fix Committed
Changed in usercouch:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.