Skip to content

Commit 016c725

Browse files
authored
Increase buffer size for logs to address unexpected log stream termination (#1939)
1 parent 47dba4b commit 016c725

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/operator/operator/workload_logging.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ func startKubectlProcess(podName string, cancelListener chan struct{}, socket *w
115115
}
116116

117117
func pumpStdout(socket *websocket.Conn, reader io.Reader) {
118+
// it seems like if the buffer is maxed out with no ending token, the scanner just exits.
119+
// increase the buffer used by the scanner to accommodate larger log lines (a common issue when printing progress)
120+
p := make([]byte, 1024*1024)
118121
scanner := bufio.NewScanner(reader)
122+
scanner.Buffer(p, 1024*1024)
119123
for scanner.Scan() {
120124
logBytes := scanner.Bytes()
121125
var message jsonMessage

0 commit comments

Comments
 (0)