C u1db should not race on db creation

Bug #987873 reported by John A Meinel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
U1DB
Fix Released
High
Unassigned

Bug Description

If you start 2 processes simultaneously that want to access a given u1db location, they can race during initialization and leave a broken db/crash on startup.

The python code has explicit 'BEGIN EXCLUSIVE' code so that the entire schema initialization is done in a single transaction. We should use this for the C code.

The biggest question is whether we can just do it, or whether we need to shoehorn in a test case. The existing test using monkey patching in the C code, mabye we can use the 'set_trace' functionality to have a more generic test.

Related branches

John A Meinel (jameinel)
Changed in u1db:
importance: Undecided → High
status: New → Confirmed
John A Meinel (jameinel)
Changed in u1db:
milestone: none → full-release
Revision history for this message
Eric Casteleijn (thisfred) wrote :

Testing is hard. Let's go shopping. (or: yes, having a test for this would be great. In it's absence doing the simple fix that prevents the race without a test is still an improvement, IMO)

Changed in u1db:
assignee: nobody → Eric Casteleijn (thisfred)
status: Confirmed → In Progress
Changed in u1db:
status: In Progress → Fix Committed
Changed in u1db:
assignee: Eric Casteleijn (thisfred) → nobody
dobey (dobey)
Changed in u1db:
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.