C u1db should not race on db creation
Bug #987873 reported by
John A Meinel
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
lp:~thisfred/u1db/c-begin-exclusive
- Samuele Pedroni: Approve
- dobey (community): Approve
-
Diff: 60 lines (+27/-6)1 file modifiedsrc/u1db.c (+27/-6)
Changed in u1db: | |
importance: | Undecided → High |
status: | New → Confirmed |
Changed in u1db: | |
milestone: | none → full-release |
Changed in u1db: | |
status: | In Progress → Fix Committed |
Changed in u1db: | |
assignee: | Eric Casteleijn (thisfred) → nobody |
Changed in u1db: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
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)