util: MultiChildLb children should always start with a NoResult picker · grpc/grpc-java@b5989a5

@@ -91,8 +91,7 @@ protected Map<Object, ChildLbState> createChildLbMap(ResolvedAddresses resolvedA

9191

if (existingChildLbState != null) {

9292

childLbMap.put(endpoint, existingChildLbState);

9393

} else {

94-

childLbMap.put(endpoint,

95-

createChildLbState(endpoint, null, getInitialPicker(), resolvedAddresses));

94+

childLbMap.put(endpoint, createChildLbState(endpoint, null, resolvedAddresses));

9695

}

9796

}

9897

return childLbMap;

@@ -102,8 +101,8 @@ protected Map<Object, ChildLbState> createChildLbMap(ResolvedAddresses resolvedA

102101

* Override to create an instance of a subclass.

103102

*/

104103

protected ChildLbState createChildLbState(Object key, Object policyConfig,

105-

SubchannelPicker initialPicker, ResolvedAddresses resolvedAddresses) {

106-

return new ChildLbState(key, pickFirstLbProvider, policyConfig, initialPicker);

104+

ResolvedAddresses resolvedAddresses) {

105+

return new ChildLbState(key, pickFirstLbProvider, policyConfig);

107106

}

108107109108

/**

@@ -187,15 +186,6 @@ protected void handleNameResolutionError(ChildLbState child, Status error) {

187186

child.lb.handleNameResolutionError(error);

188187

}

189188190-

/**

191-

* Creates a picker representing the state before any connections have been established.

192-

*

193-

* <p/>Override to produce a custom picker.

194-

*/

195-

protected SubchannelPicker getInitialPicker() {

196-

return new FixedResultPicker(PickResult.withNoResult());

197-

}

198-199189

/**

200190

* Creates a new picker representing an error status.

201191

*

@@ -365,12 +355,10 @@ public class ChildLbState {

365355366356

private final LoadBalancer lb;

367357

private ConnectivityState currentState;

368-

private SubchannelPicker currentPicker;

358+

private SubchannelPicker currentPicker = new FixedResultPicker(PickResult.withNoResult());

369359370-

public ChildLbState(Object key, LoadBalancer.Factory policyFactory, Object childConfig,

371-

SubchannelPicker initialPicker) {

360+

public ChildLbState(Object key, LoadBalancer.Factory policyFactory, Object childConfig) {

372361

this.key = key;

373-

this.currentPicker = initialPicker;

374362

this.config = childConfig;

375363

this.lb = policyFactory.newLoadBalancer(createChildHelper());

376364

this.currentState = CONNECTING;