Bug 236409 - Add YumBase.close() in order to free sqlite dbs
Summary: Add YumBase.close() in order to free sqlite dbs
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact:
URL:
Whiteboard:
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:
Clone Of:
Environment:
Last Closed: 2007-04-25 18:28:45 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
yum-3.1.6-sqlite-db-close.patch (2.57 KB, patch)
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]
yum-3.1.6-sqlite-db-close.patch

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

  https://www.redhat.com/archives/fedora-livecd-list/2007-April/msg00084.html

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.