Bug 236409 - Add YumBase.close() in order to free sqlite dbs
Add YumBase.close() in order to free sqlite dbs
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
:
Depends On:
Blocks: FC7Blocker
  Show dependency treegraph
 
Reported: 2007-04-13 13:06 EDT by Mark McLoughlin
Modified: 2014-01-21 17:57 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-04-25 14:28:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Mark McLoughlin 2007-04-13 13:06:08 EDT
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 13:06:08 EDT
Created attachment 152558 [details]
yum-3.1.6-sqlite-db-close.patch
Comment 2 Mark McLoughlin 2007-04-13 13:15:02 EDT
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 11:50:23 EDT
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 14:28:45 EDT
Applied for 3.1.7

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