[pybsddb] Closing a large read only btree takes a long time - possible to use DB_NOSYNC?

Jesus Cea jcea at argo.es
Mon Apr 7 19:48:01 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chris Mulligan wrote:
| Second, it looks like I was wrong in the end. The issue was with the
| class someone else on the team wrote. The original code looks like this,
| and the issue should be obvious, it reads the entire b-tree just to
| check if it exists. (self._db = bsddb.btopen())
|
| def close(self):
|     if self._db:
|         self._db.close()
|         self._db = None

I saw a similar issue in the "dbm" module. See
http://bugs.python.org/issue2159 .

I didn't know pybsddb was also affected. I'm patch it.

The patch I proposed in the tracker would work, but the use case is
actually different. The intention is to see if the DB is open, NOT if it
is empty.

What do you think?.

- --
Jesus Cea Avion                         _/_/      _/_/_/        _/_/_/
jcea at argo.es http://www.argo.es/~jcea/ _/_/    _/_/  _/_/    _/_/  _/_/
jabber / xmpp:jcea at jabber.org         _/_/    _/_/          _/_/_/_/_/
~                               _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBR/peTZlgi5GaxT1NAQKuUwP/Y32lKkhphdOUyckKe3IqN8m0OkR/IQLG
2izsLUyF896FV1V90/lP1MAxsPHcTOFe9C6sf81NXR79rtKuxLA1dV/dgwV4SyM4
4m4I8UmDeTMk/fa9shrU1rqdgT3VpFUly+p9iWEp2AdgbHJeUedEqe3hEBL4u1Qa
t05I2AV+Uqc=
=ZVmX
-----END PGP SIGNATURE-----



More information about the pybsddb mailing list