Skip to content

Commit

Permalink
Recv next message after send returns EOF (#7872)
Browse files Browse the repository at this point in the history
(cherry picked from commit b9a7188)
  • Loading branch information
danielnelson committed Jul 21, 2020
1 parent f685864 commit c568b59
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 c568b59

Please sign in to comment.