| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Thank you. |
Sorry, something went wrong.
Fix `git push` hanging when stdout/stderr is big
|
Wonder if this could make the async process output handling easier? |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
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.POLLERR
CLOSED = select.POLLHUP | select.POLLERR
poll.register(process.stdout, READ_ONLY)
poll.register(process.stderr, READ_ONLY)
closed_streams = set()
while True:
# no timeout
poll_result = poll.poll()
for fd, result in poll_result:
if result & CLOSED:
closed_streams.add(fd)
else:
# there is something to read - this blocks, but its okay
handle_line(fdmap[fd].readline())
# end handle closed stream
# end for each poll-result tuple
if len(closed_streams) == len(fdmap):
break
# end its all done
# end endless loophandle_line is the callback in this case which probably has an equivalent in the previous git-python implementation. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes GH-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.