Skip to content

Commit 78cb8d7

Browse files
authored
fix(ipc): increase scanner buffer size to 5MB to handle large outputs (#8841)
1 parent e26c61b commit 78cb8d7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

backend/core/utils/ipc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ func scanOutputPipe(pipe io.ReadCloser, wg *sync.WaitGroup, onReceive func([]byt
238238
responseCreator func([]byte) *ProcessResponse, outboundChannel chan<- *ProcessResponse) func() {
239239
return func() {
240240
scanner := bufio.NewScanner(pipe)
241+
scanner.Buffer(make([]byte, 5*1024*1024), 5*1024*1024)
241242
scanner.Split(bufio.ScanLines)
242243
for scanner.Scan() {
243244
src := scanner.Bytes()
@@ -256,6 +257,7 @@ func scanErrorPipe(pipe io.ReadCloser, onReceive func([]byte), outboundChannel c
256257
remoteErrorMsg := &strings.Builder{}
257258
return func() {
258259
scanner := bufio.NewScanner(pipe)
260+
scanner.Buffer(make([]byte, 5*1024*1024), 5*1024*1024)
259261
scanner.Split(bufio.ScanLines)
260262
for scanner.Scan() {
261263
src := scanner.Bytes()

0 commit comments

Comments
 (0)