Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 236409 - Add YumBase.close() in order to free sqlite dbs
Summary: Add YumBase.close() in order to free sqlite dbs
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact:
Depends On:
Blocks: FC7Blocker
TreeView+ depends on / blocked
Reported: 2007-04-13 17:06 UTC by Mark McLoughlin
Modified: 2014-01-21 22:57 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-04-25 18:28:45 UTC

Attachments (Terms of Use)
yum-3.1.6-sqlite-db-close.patch (deleted)
2007-04-13 17:06 UTC, Mark McLoughlin
no flags Details | Diff

Description Mark McLoughlin 2007-04-13 17:06:08 UTC
I'm seeing this with a livecd-creator patch I'm working on - I'll post the URL
for that here in a second when i post it.

Essentially, the problem is that running livecd-creator with this patch I'm
unable to unmount the installroot we're installing in to because yum still has
primary.xml.gz.sqlite open. Given the current yum code, it will only be closed
when the sqlite db destructor is invoked ... which will only happen an
indeterminate time after the last reference to the YumBase is dropped.

My conclusion is that YumBase needs a close() method which will cause the db
close() method to be called. Sample patch attached.

(I could dig probably dig some Python docs somewhere that explain why it's good
practice for any object which holds an open fd needs a close() method, but I
think that's fairly well known)

Comment 1 Mark McLoughlin 2007-04-13 17:06:08 UTC
Created attachment 152558 [details]

Comment 2 Mark McLoughlin 2007-04-13 17:15:02 UTC
The livecd-creator patch is here:

Comment 3 Jeremy Katz 2007-04-16 15:50:23 UTC
This looks reasonable, although unfortunate that it has to be explicit.  Then
again, in most cases, it won't ever need to be done so having it explicit for
the few times when it is needed is probably okay

Comment 4 Jeremy Katz 2007-04-25 18:28:45 UTC
Applied for 3.1.7

Note You need to log in before you can comment on or make changes to this bug.