Commit 683c14ca authored by Olivier Bornet's avatar Olivier Bornet Committed by Kamil Trzciński

Prevent runner to be stealth if we reach the MaxTraceOutputSize.

Stopping the reader.ReadRune() if we reach the MaxTraceOutputSize stop
the processing of the build.

Conflicts:
	executors/executor_abstract.go
parent f5c5eb3c
......@@ -31,11 +31,16 @@ type AbstractExecutor struct {
func (e *AbstractExecutor) ReadTrace(pipe *io.PipeReader) {
defer e.Debugln("ReadTrace finished")
traceStopped := false
reader := bufio.NewReader(pipe)
for {
r, s, err := reader.ReadRune()
if s <= 0 {
break
} else if traceStopped {
// ignore symbols if build log exceeded limit
continue
} else if err == nil {
e.Build.WriteRune(r)
} else {
......@@ -44,8 +49,9 @@ func (e *AbstractExecutor) ReadTrace(pipe *io.PipeReader) {
}
if e.Build.BuildLogLen() > common.MaxTraceOutputSize {
output := fmt.Sprintf("\nBuild log exceed limit of %v bytes.", common.MaxTraceOutputSize)
output := fmt.Sprintf("\nBuild log exceeded limit of %v bytes.", common.MaxTraceOutputSize)
e.Build.WriteString(output)
traceStopped = true
break
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment