Skip to content

Commit

Permalink
fix: leak stream (#12193)
Browse files Browse the repository at this point in the history
Signed-off-by: weidongcai <cwdsuzhou@gmail.com>
  • Loading branch information
cwdsuzhou committed Nov 20, 2023
1 parent 75d7eb1 commit 9eadf2d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion util/logs/workflow-logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ func WorkflowLogs(ctx context.Context, wfClient versioned.Interface, kubeClient
logCtx.Error(err)
return
}

defer func() {
if err := stream.Close(); err != nil {
logCtx.Warn("Failed to close stream", err)
}
}()
scanner := bufio.NewScanner(stream)
//give it more space for long line
scanner.Buffer(make([]byte, startBufSize), maxTokenLength)
Expand Down

0 comments on commit 9eadf2d

Please sign in to comment.