Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many open files error #27

Closed
dotwaffle opened this issue Jun 2, 2016 · 1 comment
Closed

Too many open files error #27

dotwaffle opened this issue Jun 2, 2016 · 1 comment

Comments

@dotwaffle
Copy link

Occasionally, if I haven't used gitup for some time and I run it, it will end with a "too many open files" error. I believe this is due to file handles not being closed after usage, but I can't be sure -- I haven't dug into the code.

Here's a sample error:

    rancid:
        Fetching origin (6/6)Traceback (most recent call last):
  File "/usr/local/Cellar/gitup/0.3/libexec/bin/gitup", line 9, in <module>
    load_entry_point('gitup==0.3', 'console_scripts', 'gitup')()
  File "/usr/local/Cellar/gitup/0.3/libexec/lib/python2.7/site-packages/gitup/script.py", line 100, in run
    main()
  File "/usr/local/Cellar/gitup/0.3/libexec/lib/python2.7/site-packages/gitup/script.py", line 95, in main
    update_bookmarks(get_bookmarks(), update_args)
  File "/usr/local/Cellar/gitup/0.3/libexec/lib/python2.7/site-packages/gitup/update.py", line 212, in update_bookmarks
    _update_directory(path, update_args)
  File "/usr/local/Cellar/gitup/0.3/libexec/lib/python2.7/site-packages/gitup/update.py", line 201, in _update_directory
    _update_subdirectories(path, update_args)
  File "/usr/local/Cellar/gitup/0.3/libexec/lib/python2.7/site-packages/gitup/update.py", line 185, in _update_subdirectories
    _update_repository(repo, *update_args)
  File "/usr/local/Cellar/gitup/0.3/libexec/lib/python2.7/site-packages/gitup/update.py", line 166, in _update_repository
    _fetch_remotes(remotes)
  File "/usr/local/Cellar/gitup/0.3/libexec/lib/python2.7/site-packages/gitup/update.py", line 75, in _fetch_remotes
    results = remote.fetch(progress=_ProgressMonitor())
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/git/remote.py", line 651, in fetch
    res = self._get_fetch_info_from_stderr(proc, progress or RemoteProgress())
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/git/remote.py", line 588, in _get_fetch_info_from_stderr
    for err_line, fetch_line in zip(fetch_info_lines, fetch_head_info))
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/git/remote.py", line 588, in <genexpr>
    for err_line, fetch_line in zip(fetch_info_lines, fetch_head_info))
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/git/remote.py", line 276, in _from_line
    old_commit = repo.rev_parse(operation.split(split_token)[0])
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/git/repo/fun.py", line 304, in rev_parse
    obj = name_to_object(repo, rev)
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/git/repo/fun.py", line 89, in name_to_object
    hexsha = short_to_long(repo.odb, name)
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/git/repo/fun.py", line 70, in short_to_long
    return bin_to_hex(odb.partial_to_complete_sha_hex(hexsha))
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/gitdb/db/base.py", line 258, in partial_to_complete_sha_hex
    full_bin_sha = db.partial_to_complete_sha(partial_binsha, len_partial_hexsha)
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/gitdb/db/pack.py", line 192, in partial_to_complete_sha
    item_index = item[1].index().partial_sha_to_index(partial_binsha, canonical_length)
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/gitdb/pack.py", line 459, in partial_sha_to_index
    get_sha = self.sha
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/gitdb/util.py", line 237, in __getattr__
    self._set_cache_(attr)
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/gitdb/pack.py", line 289, in _set_cache_
    mmap = self._cursor.map()
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/gitdb/util.py", line 237, in __getattr__
    self._set_cache_(attr)
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/gitdb/pack.py", line 278, in _set_cache_
    self._cursor = mman.make_cursor(self._indexpath).use_region()
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/smmap/mman.py", line 129, in use_region
    self._region = man._obtain_region(self._rlist, offset, size, flags, False)
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/smmap/mman.py", line 573, in _obtain_region
    return self._obtain_region(a, offset, size, flags, True)
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/smmap/mman.py", line 561, in _obtain_region
    r = self.MapRegionCls(a.path_or_fd(), mid.ofs, mid.size, flags)
  File "/usr/local/Cellar/gitup/0.3/libexec/vendor/lib/python2.7/site-packages/smmap/util.py", line 167, in __init__
    self._mf = mmap(fd, actual_size, **kwargs)
mmap.error: [Errno 24] Too many open files

It happens when I have approx 20+ git repos in a directory, and only the parent is added to gitup, rather than each repo individually. It also doesn't happen every time, it only happens sometimes -- and generally if there's a lot of changes.

This is on the latest OSX, using version 0.3 from homebrew.

@dotwaffle
Copy link
Author

Oops, appears to be a closed issue. #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant