Skip to content

Commit

Permalink
xds/client: reset backoff when a message is received, even when the m…
Browse files Browse the repository at this point in the history
…essage is invalid (#5241)
  • Loading branch information
menghanl committed Mar 14, 2022
1 parent 722367c commit 84793b5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions xds/internal/xdsclient/controller/transport.go
Expand Up @@ -188,17 +188,17 @@ func (t *Controller) sendExisting(stream grpc.ClientStream) bool {
// recv receives xDS responses on the provided ADS stream and branches out to
// message specific handlers.
func (t *Controller) recv(stream grpc.ClientStream) bool {
success := false
msgReceived := false
for {
resp, err := t.vClient.RecvResponse(stream)
if err != nil {
t.updateHandler.NewConnectionError(err)
t.logger.Warningf("ADS stream is closed with error: %v", err)
return success
return msgReceived
}
msgReceived = true

rType, version, nonce, err := t.handleResponse(resp)

if e, ok := err.(xdsresourceversion.ErrResourceTypeUnsupported); ok {
t.logger.Warningf("%s", e.ErrStr)
continue
Expand All @@ -221,7 +221,6 @@ func (t *Controller) recv(stream grpc.ClientStream) bool {
stream: stream,
})
t.logger.Infof("Sending ACK for response type: %v, version: %v, nonce: %v", rType, version, nonce)
success = true
}
}

Expand Down

0 comments on commit 84793b5

Please sign in to comment.