Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork939
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
Fixgit push
hanging when stdout/stderr is big#184
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Thank you. |
Fix `git push` hanging when stdout/stderr is big
Wonder if this could make the async process output handling easier? |
Or this: 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. |
Admittedly, I haven't thoroughly looked at it, maybe because I would try not to pull in an additional dependency. 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
|
FixesGH-145
Sample program:
Without this change:
With this change:
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.