Bug 236409

Summary: Add YumBase.close() in order to free sqlite dbs
Product: [Fedora] Fedora Reporter: Mark McLoughlin <markmc>
Component: yumAssignee: Jeremy Katz <katzj>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-04-25 18:28:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 150226    
Attachments:
Description Flags
yum-3.1.6-sqlite-db-close.patch none

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