Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixgit push hanging when stdout/stderr is big#184

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Byron merged 1 commit intogitpython-developers:masterfromSurveyMonkey:GH-145_fix_git_push_hang
Aug 17, 2014
Merged

Fixgit push hanging when stdout/stderr is big#184

Byron merged 1 commit intogitpython-developers:masterfromSurveyMonkey:GH-145_fix_git_push_hang
Aug 17, 2014

Conversation

msabramo
Copy link

FixesGH-145

Sample program:

# test_git_push_hang.pyimportgitrepo=git.Repo('.')remote=git.Remote(repo,'origin')remote.push(tags=True)

Without this change:

$ python test_git_push_hang.pyPushing tags to remote...(hangs indefinitely)

With this change:

$ python test_git_push_hang.pyPushing tags to remote...Tags pushed: 993

Cc:@Byron,@sontek,@colinmsaunders,@willwagner, @monkeydiane

This is what seems to be causing our Doula builds to stall when git repos have a lot of tags. Hopefully this fixes that issue.

@Byron
Copy link
Member

Thank you.
This fix will also remove git-pythons ability to respond to progress as it happens. However, the fix seems more important for now, and an implementation using poll/select can be done at a later time to get back the real-time consumption of git command progress.

Byron added a commit that referenced this pull requestAug 17, 2014
Fix `git push` hanging when stdout/stderr is big
@ByronByron merged commit6d3d94c intogitpython-developers:masterAug 17, 2014
@msabramo
Copy link
Author

Wonder if this could make the async process output handling easier?

https://pypi.python.org/pypi/shelljob

@msabramo
Copy link
Author

Or this:

http://amoffat.github.io/sh/

Aside from the magic this one does to make external commands look like python functions (which you don't have to use if you don't want), it also seems to handle async I/O and then exposes a nice interface using either a generator or a callback.

@Byron
Copy link
Member

Admittedly, I haven't thoroughly looked at it, maybe because I would try not to pull in an additional dependency.
Trolling through another project of mine, I found code that will do async handling of a processes stdout and stderr, it's not to difficult after all (provided we are on a OS that supportspoll().

fdmap= {process.stdout.fileno() :process.stdout,process.stderr.fileno() :process.stderr }poll=select.poll()READ_ONLY=select.POLLIN|select.POLLPRI|select.POLLHUP|select.POLLERRCLOSED=select.POLLHUP|select.POLLERRpoll.register(process.stdout,READ_ONLY)poll.register(process.stderr,READ_ONLY)closed_streams=set()whileTrue:# no timeoutpoll_result=poll.poll()forfd,resultinpoll_result:ifresult&CLOSED:closed_streams.add(fd)else:# there is something to read - this blocks, but its okayhandle_line(fdmap[fd].readline())# end handle closed stream# end for each poll-result tupleiflen(closed_streams)==len(fdmap):break# end its all done# end endless loop

handle_line is the callback in this case which probably has an equivalent in the previous git-python implementation.

@ByronByron added this to thev0.3.5 - bugfixes milestoneNov 14, 2014
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Push tags=True blocks on github
2 participants
@msabramo@Byron

[8]ページ先頭

©2009-2025 Movatter.jp