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

git fat pull hangs on linux #46

Open
duanem opened this issue Aug 1, 2014 · 10 comments
Open

git fat pull hangs on linux #46

duanem opened this issue Aug 1, 2014 · 10 comments

Comments

@duanem
Copy link

duanem commented Aug 1, 2014

I'm using git-fat on linux with git version 1.8.5.5 and python version 2.6.6.

git fat pull hangs.

My preliminary debugging indicates that filter_gitfat_candidates never completes.

All three data processing threads start (cut_sha1hash, filter_gitfat_candidates, and metadata processing). cut_sha1hash ends, but filter_gitfat_candidates never completes, hanging the program.

I am using the latest git-fat code (is git-fat versioned yet?)

I wanted to report this as soon as possible. I will continue debugging.

Hints to a possible problem would be great.

@jedbrown
Copy link
Owner

jedbrown commented Aug 1, 2014

Can you give instructions to reproduce?

Duane Murphy [email protected] writes:

I'm using git-fat on linux with git version 1.8.5.5 and python version 2.6.6.

git fat pull hangs.

My preliminary debugging indicates that filter_gitfat_candidates never completes.

All three data processing threads start (cut_sha1hash, filter_gitfat_candidates, and metadata processing). cut_sha1hash ends, but filter_gitfat_candidates never completes, hanging the program.

I am using the latest git-fat code (is git-fat versioned yet?)

I wanted to report this as soon as possible. I will continue debugging.

Hints to a possible problem would be great.


Reply to this email directly or view it on GitHub:
#46

@duanem
Copy link
Author

duanem commented Aug 1, 2014

Can you give instructions to reproduce?

Sure.
* Setup git-fat with some binary files
• git fat pull
* Hang

I have a large repository. git rev-list returns 363110 objects.

I'm not sure if the size is the limitation or not.

The same code does not hang on Mac OS, git 1.8.5.2, python 2.7.5.

@jedbrown
Copy link
Owner

jedbrown commented Aug 1, 2014

Does ./test.sh run for you? What protocol are you using? Is the remote
host reachable?

Duane Murphy [email protected] writes:

Can you give instructions to reproduce?

Sure.

  • Setup git-fat with some binary files
    • git fat pull
  • Hang

I have a large repository. git rev-list returns 363110 objects.

I'm not sure if the size is the limitation or not.

The same code does not hang on Mac OS, git 1.8.5.2, python 2.7.5.


Reply to this email directly or view it on GitHub:
#46 (comment)

@duanem
Copy link
Author

duanem commented Aug 1, 2014

Does ./test.sh run for you?

Nope. Hangs in exactly the same spot. I'm using git fat pull, the test hangs at git fat push.

What protocol are you using?
Is the remote host reachable?

Has nothing to do with the remote host. The hang is in referenced_objects, before the host is contacted.
git rev-list --object | cut_sha1hash | git cat-file --batch-check | filter_gitfat_candidates | from cat-file --batch. cut_sha1hash finishes, but filter_gitfat_candidates does not.

@duanem
Copy link
Author

duanem commented Aug 1, 2014

A ps helps to identify more state:

duane     3862 27132  0 12:33 pts/0    00:00:00 /bin/bash -ex ./test.sh
duane     3948  3862  0 12:33 pts/0    00:00:00 git fat push
duane     3949  3948  0 12:33 pts/0    00:00:00 python /home/duane/bin/git-fat push
duane     3953  3949  0 12:33 pts/0    00:00:00 [git] <defunct>
duane     3954  3949  0 12:33 pts/0    00:00:00 git cat-file --batch-check
duane     3955  3949  0 12:33 pts/0    00:00:00 git cat-file --batch

[git] <defunct> is the left over git rev-list command which has completed. git cat-file --batch-check is still running even though, cut_sha1hash has closed the output to that process.

Why would close not be enough? Hmm...

@duanem
Copy link
Author

duanem commented Aug 2, 2014

I upgraded python to 2.7.8. This seems to have fixed the problem.

I'd sure like to know how to work around this problem in python 2.6.

I guess, I'll close this issue?

@duanem duanem closed this as completed Aug 2, 2014
@jedbrown
Copy link
Owner

jedbrown commented Aug 2, 2014

The problem is http://bugs.python.org/issue12786 (fixed in 2.7 and
later) but the most convenient fixes have Windows portability problems.
I'll fix it.

Duane Murphy [email protected] writes:

I upgraded python to 2.7.8. This seems to have fixed the problem.

I'd sure like to know how to work around this problem in python 2.6.

I guess, I'll close this issue?


Reply to this email directly or view it on GitHub:
#46 (comment)

@jedbrown jedbrown reopened this Aug 2, 2014
@duanem
Copy link
Author

duanem commented Aug 6, 2014

Thank you for finding this problem. You're google fu is better than mine.

I look forward to seeing the fix. I did the obvious, addition of close_fds=True to all of the subprocesses involved in the threads. That fixes the problem on Linux, but as the bug indicates there is a problem on Windows. Occasionally, Windows will hang during this process now [sigh].

It seems like the threading is not really providing any benefit as Python is inherently single threaded. I'm considering a rewrite of that section using generators.

@jedbrown
Copy link
Owner

jedbrown commented Aug 6, 2014

issue12786 is really a catastrophy for portability. I'm surprised there
is no documented best practice. The threads are not for performance,
but rather to construct a pipeline containing some non-Python parts and
some Python parts. Deadlock is caused by subprocess, not threading.

@fishuyo
Copy link

fishuyo commented Sep 21, 2015

I'm having what appears to be a similar issue..

git fat pull is hanging on OSX 10.10.5 with system python version 2.7.10

However it works fine if I install python using brew which right now is also version 2.7.10

This was referenced Sep 12, 2019
kbrewersq pushed a commit to kbrewersq/git-fat that referenced this issue May 21, 2021
Support partial pulls and respect GIT_SSH
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

3 participants