File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -313,6 +313,18 @@ impl BashExecutor {
313313 let _ = stdout_handle. join ( ) ;
314314 let _ = stderr_handle. join ( ) ;
315315
316+ // Readers drain the pipe to EOF, so the overflow flag now
317+ // reflects the full output. Recheck because a child that
318+ // exits faster than one supervisor tick breaks the loop via
319+ // try_wait before the in-loop overflow check has run.
320+ if termination. is_none ( ) {
321+ if stdout_overflow. load ( Ordering :: SeqCst ) {
322+ termination = Some ( TerminationReason :: StdoutCapExceeded ) ;
323+ } else if stderr_overflow. load ( Ordering :: SeqCst ) {
324+ termination = Some ( TerminationReason :: StderrCapExceeded ) ;
325+ }
326+ }
327+
316328 if let Some ( e) = try_wait_error {
317329 return Err ( SofosError :: ToolExecution ( format ! (
318330 "Failed to wait on command: {}" ,
You can’t perform that action at this time.
0 commit comments