[packagekit] Fun things that happen when the transaction db doesn't open

Richard Hughes hughsient at gmail.com
Tue Nov 6 14:54:05 PST 2007


On Tue, 2007-11-06 at 23:50 +0100, Tom Parker wrote:
> In short, packagekit goes *splut*. Firstly, there's an error in the
> code which means that a reference to the not-opened db sticks around
> (or at least it looks like this is possible, depends on the precise
> behaviour of sqlite3_open in this case). Secondly, every other call
> into the transaction functions does funny things because it's trying
> to play around with this borked pointer.

Anything that stops a *splut* is a good thing in my book.

> Admittedly, the case where I ran into this was when I hadn't installed
> anything for PackageKit, and was trying to run it from the src dir
> (without even the relevant directory being available for pk to write
> to), but it's still bad. My suggestion: change the pk_warning on
> transaction db open failure to an error, 'cause it's a very bad thing.
> Patch attached to do that. Alternate options include falling back on
> simply dropping all transaction related stuff if the db can't be
> opened, but that's not so healthy.

Agree, just error out if the database is not present. The idea was to
recreate the db file if not found, as this means we can nuke the file
and still get the daemon recreate it. I'm not sure how sane that is.

Richard.





More information about the PackageKit mailing list