Merge lp:~seb128/software-center/invalid_db_open into lp:software-center

Proposed by Sebastien Bacher
Status: Merged
Approved by: dobey
Approved revision: 3325
Merged at revision: 3332
Proposed branch: lp:~seb128/software-center/invalid_db_open
Merge into: lp:software-center
Diff against target: 15 lines (+2/-2)
1 file modified
softwarecenter/backend/reviews/__init__.py (+2/-2)
To merge this branch: bzr merge lp:~seb128/software-center/invalid_db_open
Reviewer Review Type Date Requested Status
dobey Approve
Michael Vogt Approve
Review via email: mp+273113@code.launchpad.net

Commit message

DB_NOMMAP needs to be set using set_flags, it's not valid in DBEnv.open

Description of the change

DB_NOMMAP needs to be set using set_flags, it's not valid in DBEnv.open

Note that the original commit was to fix performances problems. I suspect that the improvement had more to do with the fact that the db write was basically commented by the invalid use which makes the function hit an except before doing the work than by the flag use so the fix might create performances issues...

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks

review: Approve
Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/backend/reviews/__init__.py'
2--- softwarecenter/backend/reviews/__init__.py 2012-12-14 16:44:25 +0000
3+++ softwarecenter/backend/reviews/__init__.py 2015-10-01 17:42:59 +0000
4@@ -371,9 +371,9 @@
5 env = bdb.DBEnv()
6 if not os.path.exists(outdir):
7 os.makedirs(outdir)
8+ env.set_flags(bdb.DB_NOMMAP, True) # be gentle on e.g. nfs mounts
9 env.open(outdir,
10- bdb.DB_CREATE | bdb.DB_INIT_CDB | bdb.DB_INIT_MPOOL |
11- bdb.DB_NOMMAP, # be gentle on e.g. nfs mounts
12+ bdb.DB_CREATE | bdb.DB_INIT_CDB | bdb.DB_INIT_MPOOL,
13 0600)
14 db = bdb.DB(env)
15 db.open(outfile,