Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 358725 - hggit: too many open files on hg pull
Summary: hggit: too many open files on hg pull
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Dirkjan Ochtman (RETIRED)
URL: https://github.com/schacon/hg-git/iss...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-13 16:16 UTC by Fabian Groffen
Modified: 2011-03-13 16:59 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2011-03-13 16:16:33 UTC
% hg pull pulling from git+ssh://git@git.overlays.gentoo.org/proj/portage.git
importing Hg objects into Git
["git-upload-pack '/proj/portage.git'"] Counting objects: 3664, done.
Compressing objects: 100% (2573/2573), done.
Total 3664 (delta 2289), reused 1743 (delta 1091)
importing Git objects into Hg
abort: Too many open files: /export/gentoo/portage-hg/.hg/git/objects/pack/pack-9fb8d5a8932a495a2ed28ac993b4329a1ad3c680.pack
%

This problem stems from commit https://github.com/schacon/hg-git/commit/59c7b6d804126bde4fb85409b1cc66c01de4132c the code block for hgrepo.py around line 50 opens tf, but doesn't close it. Adding tf.close() after the tf.read line, resolves the too many open files problem.


patch is simple and straightforward:
--- hgrepo.py.orig       2011-03-13 17:09:21.000000000 +0100
+++ hgrepo.py     2011-03-13 17:09:43.000000000 +0100
@@ -55,6 +55,7 @@
             if os.path.exists(tagfile):
                 tf = open(tagfile, 'rb')
                 tagdata = tf.read().split('\n')
+                tf.close()
                 td = [line.split(' ', 1) for line in tagdata if line]
                 return dict([(name, bin(sha)) for sha, name in td])
             return {}

already reported upstream
Comment 1 Fabian Groffen gentoo-dev 2011-03-13 16:59:38 UTC
the fix works on the platform I tested by coincidence, the real problem is in dulwich, so closing.  sorry for the noise.