Skip to content

Commit

Permalink
[CWS] make sure we check if the trace pipe is closed before sending (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcacheux authored Jul 31, 2024
1 parent 1738dd4 commit d429ae3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pkg/security/tests/trace_pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,19 @@ func (t *TracePipe) Channel() (<-chan *TraceEvent, <-chan error) {
if err == io.EOF {
continue
}
channelErrors <- err
select {
case <-t.stop:
return
case channelErrors <- err:
// do nothing
}
} else {
channelEvents <- traceEvent
select {
case <-t.stop:
return
case channelEvents <- traceEvent:
// do nothing
}
}
}
}()
Expand Down

0 comments on commit d429ae3

Please sign in to comment.