Bug 617844

Summary: grabber.py leaks file objects in function _do_grab()
Product: [Fedora] Fedora Reporter: Jasper O'neal Hartline <Jasper.Hartline>
Component: python-urlgrabberAssignee: James Antill <james.antill>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: james.antill
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: 2010-07-26 17:57:19 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: 509427    
Attachments:
Description Flags
Cleans up leaked fds in grabber.py when some bad thing happens and exceptions aren't dealt with in all cases, stale fds are left none

Description Jasper O'neal Hartline 2010-07-24 10:43:47 UTC
Description of problem:
grabber.py leaks file objects in function _do_grab()


Version-Release number of selected component (if applicable):
python-urlgrabber-3.9.1-7.fc13.noarch

How reproducible:
Easily reproducible with livecd-creator from livecd-tools as a mechanism to produce the behavior. 100% reproducible.


Steps to Reproduce:
0. make repo in livecd.ks unreachable or invalid
1. livecd-creator -c livecd.ks
2. Fails with unable to find repository but also faceplants when unmounting
3.
  
Actual results:
livecd-creator faceplants when trying to cleanup()
in which time it should unmount some filesystems which are bind mounted and
cannot since the process still holds file descriptors open to files which once existed in the directories.

Expected results:
Should unmount cleanly. 
Will attach a patch which cleans up this leaked fd.

Additional info:

Comment 1 Jasper O'neal Hartline 2010-07-24 10:47:14 UTC
Created attachment 434129 [details]
Cleans up leaked fds in grabber.py when some bad thing happens and exceptions aren't dealt with in all cases, stale fds are left

Comments above.

Comment 2 seth vidal 2010-07-26 17:57:19 UTC
patch added and credited - thanks for the fix- it'll go out in the next release