MCPcopy
hub / github.com/grpc/grpc-go / applyFailingLBLocked

Method applyFailingLBLocked

clientconn.go:880–890  ·  view source on GitHub ↗

applyFailingLBLocked is akin to configuring an LB policy on the channel which always fails RPCs. Here, an actual LB policy is not configured, but an always erroring picker is configured, which returns errors with information about what was invalid in the received service config. A config selector wi

(sc *serviceconfig.ParseResult)

Source from the content-addressed store, hash-verified

878// service config is configured, and the connectivity state of the channel is
879// set to TransientFailure.
880func (cc *ClientConn) applyFailingLBLocked(sc *serviceconfig.ParseResult) {
881 var err error
882 if sc.Err != nil {
883 err = status.Errorf(codes.Unavailable, "error parsing service config: %v", sc.Err)
884 } else {
885 err = status.Errorf(codes.Unavailable, "illegal service config type: %T", sc.Config)
886 }
887 cc.safeConfigSelector.UpdateConfigSelector(&defaultConfigSelector{nil})
888 cc.pickerWrapper.updatePicker(base.NewErrPicker(err))
889 cc.csMgr.updateState(connectivity.TransientFailure)
890}
891
892// Makes a copy of the input addresses slice. Addresses are passed during
893// subconn creation and address update operations.

Callers 1

Calls 5

ErrorfFunction · 0.92
NewErrPickerFunction · 0.92
UpdateConfigSelectorMethod · 0.80
updatePickerMethod · 0.80
updateStateMethod · 0.45

Tested by

no test coverage detected