Description
When calling Git.execute
, including indirectly through the dynamic methods of a Git
object, passing a non-None
value of output_stream
suppresses the effect of kill_after_timeout
. The threading.Timer
object is created with the local kill_process
function as its callback, but start
is never called on it.
Lines 1050 to 1079 in a58a6be
This situation appears not entirely intentional, because:
- The "watchdog"
Timer
is created, even though it is never used. - The docstring, even as it documents that
as_process
suppresseskill_after_timeout
(and thatas_process
suppressesoutput_stream
), does not mention any effect ofoutput_stream
onkill_after_timeout
.
So either kill_after_timeout
should be honored even when output_stream
is used, or the docstring should be updated to mention that it does not (and the code possibly modified to not create the Timer
object in the case that it is unused).
I am not sure which change should be made, so I'm opening this rather than a PR to propose one of them.
This is effectively separate from #1756. (One quality this shares with #1756 is that it is relevant only to the behavior of Git.execute
and functions that use it. Functions that use handle_process_output
are unaffected; its kill_after_timeout
is implemented differently with nonequivalent behavior and separate code. handle_process_output
also does not take an output_stream
argument.)