Skip to content

Commit 79e1bee

Browse files
committed
Update CommandCombinedOutputToWriter, remove wait on cmd timeout
The wait function somehow causes the goroutine to stuck / hang forever. Since it happens on timeout, it seems ok to not wait.
1 parent cb04d7b commit 79e1bee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/capture/executils/shell.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ func CommandCombinedOutputToWriter(writer io.Writer, cmd Command, hookers ...Hoo
167167
select {
168168
case <-timer.C:
169169
logger.Log("Timeout happened during the command execution (%s) [%s]", timerDuration.String(), c.String())
170-
err = c.KillAndWait()
170+
err = c.Kill()
171171
if err != nil {
172-
logger.Log("Error doing cmd.KillAndWait() invocation: [%s]", err.Error())
172+
logger.Log("Error doing cmd.Kill() invocation: [%s]", err.Error())
173173
}
174174
case <-channelDone:
175175
timer.Stop()

0 commit comments

Comments
 (0)