Bug 7663 - Layer index failing to update due to too many open files
Summary: Layer index failing to update due to too many open files
Status: VERIFIED FIXED
Alias: None
Product: Layer Index
Classification: Yocto Project Subprojects
Component: Layer Index (show other bugs)
Version: unspecified
Hardware: All Multiple
: High major
Target Milestone: 1.9 M1
Assignee: Paul Eggleton
QA Contact: Alexandru Georgescu
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-04-27 13:23 UTC by Paul Eggleton
Modified: 2016-11-03 07:10 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Eggleton 2015-04-27 13:23:32 UTC
The layer index update script is tripping over this every time it runs:

-------------- snip --------------
Traceback (most recent call last):
  File "/var/www/html/layerindex/layerindex/update.py", line 304, in main
  File "/usr/local/lib/python2.7/dist-packages/git/repo/base.py", line 420, in iter_commits
  File "/usr/local/lib/python2.7/dist-packages/git/objects/commit.py", line 192, in iter_items
  File "/usr/local/lib/python2.7/dist-packages/git/cmd.py", line 219, in <lambda>
  File "/usr/local/lib/python2.7/dist-packages/git/cmd.py", line 430, in _call_process
  File "/usr/local/lib/python2.7/dist-packages/git/cmd.py", line 309, in execute
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
  File "/usr/lib/python2.7/subprocess.py", line 1135, in _execute_child
  File "/usr/lib/python2.7/subprocess.py", line 1091, in pipe_cloexec
OSError: [Errno 24] Too many open files
-------------- snip --------------

This may be related to the fact that we aren't processing any events generated during parsing and thus these are stacking up in memory; perhaps there are open file handles associated with these as well.
Comment 1 Paul Eggleton 2015-04-27 13:32:44 UTC
I should mention that this is not a new issue, it's been happening for some time now and is only getting worse as the database has grown in size.
Comment 2 Aníbal Limón 2015-05-06 16:04:00 UTC
It seems an known issue [1] and it's fixed since v0.3.5, i think with an upgrade should be enough to solve the problem the current version is 1.0.1 [2].


[1] https://github.com/gitpython-developers/GitPython/issues/60
[2] https://pypi.python.org/pypi/GitPython/1.0.1
Comment 3 Paul Eggleton 2015-06-14 23:18:27 UTC
I had a look into this since we were not only leaking file handles, but also memory. I've applied the following fix:

http://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/commit/?id=f4b45258589185fd8bb7f220470a72650dc792f8

After this everything should now be working much better - at least a refresh can now be run successfully. I'll mark this as fixed for now, if we see the problem again we can reopen.
Comment 4 Paul Eggleton 2015-06-15 09:26:22 UTC
An additional fix for the fix for compatibility with daisy and earlier:

http://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/commit/?id=40f1d51de67645506cbe7becb625cbcaeaa9f716
Comment 5 Alexandru Georgescu 2015-08-24 09:35:55 UTC
(In reply to comment #4)
> An additional fix for the fix for compatibility with daisy and earlier:
> 
> http://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/commit/
> ?id=40f1d51de67645506cbe7becb625cbcaeaa9f716

Seems that the issue is fixed after Paul's confirmation.