Skip to content

Commit

Permalink
resolver: document handling UpdateState errors by resolvers (#6002)
Browse files Browse the repository at this point in the history
Extend the Godoc for resolver.ClientConn.UpdateState with a
description of how resolvers should handle returned errors.

The description is based on the explanation of dfawley in
#5048
  • Loading branch information
fho authored Feb 8, 2023
1 parent ceb3f07 commit 55dfae6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions resolver/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@ type State struct {
// gRPC to add new methods to this interface.
type ClientConn interface {
// UpdateState updates the state of the ClientConn appropriately.
//
// If an error is returned, the resolver should try to resolve the
// target again. The resolver should use a backoff timer to prevent
// overloading the server with requests. If a resolver is certain that
// reresolving will not change the result, e.g. because it is
// a watch-based resolver, returned errors can be ignored.
//
// If the resolved State is the same as the last reported one, calling
// UpdateState can be omitted.
UpdateState(State) error
// ReportError notifies the ClientConn that the Resolver encountered an
// error. The ClientConn will notify the load balancer and begin calling
Expand Down

0 comments on commit 55dfae6

Please sign in to comment.