Mercurial > kallithea
changeset 5777:7e67883ee300
vcs: fix processing of git commands that return output on stderr
The subprocessio module used for interfacing with Git is using threading. It
might not be fully deterministic.
The subprocessio module also had the "feature" that it stopped reading and
reported failure once it found output on stderr - even if the command completed
(or would complete) with success.
Sometimes (like https://drone.io/bitbucket.org/domruf/kallithea/24 ) tests on
linux could fail on totally normal informational output like:
Couldn't run git command (['git', '-c', 'core.quotepath=false', 'checkout', 'foobranch']).
Original error was: Subprocess exited due to an error:
Switched to branch 'foobranch'
On Windows it would fail even more often.
To fix that, ignore stderr while processing output. There is a risk that it in
some cases can make the process block on stderr and thus never finish ... but
there is no reports of that yet.
author | domruf <dominikruf@gmail.com> |
---|---|
date | Thu, 03 Mar 2016 18:44:08 +0100 |
parents | 3f646f7bac39 |
children | 64e2d5a291a7 |
files | kallithea/lib/vcs/subprocessio.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/lib/vcs/subprocessio.py Tue Feb 16 22:15:30 2016 +0100 +++ b/kallithea/lib/vcs/subprocessio.py Thu Mar 03 18:44:08 2016 +0100 @@ -355,7 +355,7 @@ starting_values) bg_err = BufferedGenerator(_p.stderr, 16000, 1, bottomless=True) - while not bg_out.done_reading and not bg_out.reading_paused and not bg_err.length: + while not bg_out.done_reading and not bg_out.reading_paused: # doing this until we reach either end of file, or end of buffer. bg_out.data_added_event.wait(1) bg_out.data_added_event.clear()