Skip to content

GitCommandNotFound: [Errno 24] Too many open files #507

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

Closed
emcek opened this issue Sep 3, 2016 · 3 comments
Closed

GitCommandNotFound: [Errno 24] Too many open files #507

emcek opened this issue Sep 3, 2016 · 3 comments

Comments

@emcek
Copy link

emcek commented Sep 3, 2016

I'm not sure there is any correlation to #60, but for GitPython-2.0.7 I got:

Traceback (most recent call last):
  File "/home/emc/auto/repository/trt.py", line 105, in run
    self._update_test_repository()
  File "/home/emc/auto/repository/trt.py", line 368, in _update_test_repository
    update_repository(self.repository)
  File "/home/emc/auto/repository/utils/repository.py", line 29, in update_repository
    if repo.check_repository_type(repository_type=repo_type) and repo.is_repo_clean():
  File "/home/emc/auto/repository/gitrepository.py", line 112, in is_repo_clean
    dirty = self.repo.is_dirty()
  File "/home/emc/virtualenvs/emc/lib/python2.7/site-packages/git/repo/base.py", line 606, in is_dirty
    len(self.git.diff('--cached', *default_args)):
  File "/home/emc/virtualenvs/emc/lib/python2.7/site-packages/git/cmd.py", line 463, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "/home/emc/virtualenvs/emc/lib/python2.7/site-packages/git/cmd.py", line 929, in _call_process
    return self.execute(make_call(), **_kwargs)
  File "/home/emc/virtualenvs/emc/lib/python2.7/site-packages/git/cmd.py", line 625, in execute
    raise GitCommandNotFound(str(err))
GitCommandNotFound: [Errno 24] Too many open files
@Byron
Copy link
Member

Byron commented Sep 11, 2016

There are two issues here, even though I think only one could be approached. Firstly, the git command could not be spawned as the system appears be out of resources. As GitPython spawns a process, it should have it's own limit of open files, so it appears to be the OS being unable to open any more files for the current user. This is something entirely out of GitPython's control.

However, GitPython just assumes that probably the git command was not found, and throws a GitCommandNotFound exception, which is wrong in this case. I believe this was implemented assuming it would be correct most of the time. Changing the name of said exception would be breaking, so I would rather not want to do it.

What would you want to see happen here ?

@emcek
Copy link
Author

emcek commented Sep 11, 2016

I got your point, I will try to monitor system resources, but it just happen first time and I use GitPython (in my project) heavily since ~1 year, so you can close the issue as you wish.

@Byron
Copy link
Member

Byron commented Sep 11, 2016

Thanks for your feedback, please let me know if you find anything else. Generally, freeing system resources is somewhat broken in GitPython as it relies on destructors for the most part, which are highly non-deterministic these days.

@Byron Byron closed this as completed Sep 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants