Skip to content

Commit

Permalink
Recv next message after send returns EOF (influxdata#7872)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnelson authored Jul 21, 2020
1 parent 5efce71 commit b9a7188
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/inputs/gnmi/gnmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ func (c *GNMI) subscribeGNMI(ctx context.Context, address string, tlscfg *tls.Co
}

if err = subscribeClient.Send(request); err != nil {
return fmt.Errorf("failed to send subscription request: %v", err)
// If io.EOF is returned, the stream may have ended and stream status
// can be determined by calling Recv.
if err != io.EOF {
return fmt.Errorf("failed to send subscription request: %v", err)
}
}

c.Log.Debugf("Connection to gNMI device %s established", address)
Expand Down

0 comments on commit b9a7188

Please sign in to comment.