Skip to content

Commit

Permalink
Previously this was deadlocking and would never complete; basically l…
Browse files Browse the repository at this point in the history
…eading to a memory leak.

The documentation implied something which doesn't seem to actually be true when looked at in the detail: golang/go#27169
  • Loading branch information
infraweavers committed Feb 19, 2021
1 parent 69dc8a8 commit 0cd9c41
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions internal/web/apiv1_runscript.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ func runScript(responseWriter http.ResponseWriter, scriptToRun Script) []byte {
}()

output, error := command.CombinedOutput()

if processKiller.Stop() == false {
<-processKiller.C
}
processKiller.Stop()

runningProcesses.mutex.Lock()
delete(runningProcesses.collection, command)
Expand Down

0 comments on commit 0cd9c41

Please sign in to comment.