GadgetTracerManager: Fix error handling for Stream() operation
If the sender is reporting that the channel is full, do not close the
grpc stream but only report the error and continue processing the events.
This is the same approach we're following in trace gadgets when the perf
ring buffer is full.
@@ -122,9 +122,13 @@ func (g *GadgetTracerManager) ReceiveStream(tracerID *pb.TracerID, stream pb.Gad
}
line, _ := json.Marshal(ev)
err := stream.Send(&pb.StreamData{Line: string(line)})
+ if err != nil {
return err
}
+ continue
+ }
+
line := &pb.StreamData{Line: l.Line}
if err := stream.Send(line); err != nil {
return err
