Skip to content

Commit

Permalink
Don't allow null load balancing configs
Browse files Browse the repository at this point in the history
  • Loading branch information
murgatroid99 committed May 5, 2020
1 parent 6e202e0 commit 7aa9177
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions packages/grpc-js/src/load-balancer-child-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,9 @@ export class ChildLoadBalancerHandler implements LoadBalancer {
*/
updateAddressList(
addressList: SubchannelAddress[],
lbConfig: LoadBalancingConfig | null,
lbConfig: LoadBalancingConfig,
attributes: { [key: string]: unknown }
): void {
if (lbConfig === null) {
return;
}
let childToUpdate: LoadBalancer;
if (
this.currentChild === null ||
Expand Down
2 changes: 1 addition & 1 deletion packages/grpc-js/src/load-balancer-pick-first.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ export class PickFirstLoadBalancer implements LoadBalancer {

updateAddressList(
addressList: SubchannelAddress[],
lbConfig: LoadBalancingConfig | null
lbConfig: LoadBalancingConfig
): void {
// lbConfig has no useful information for pick first load balancing
/* To avoid unnecessary churn, we only do something with this address list
Expand Down
2 changes: 1 addition & 1 deletion packages/grpc-js/src/load-balancer-round-robin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export class RoundRobinLoadBalancer implements LoadBalancer {

updateAddressList(
addressList: SubchannelAddress[],
lbConfig: LoadBalancingConfig | null
lbConfig: LoadBalancingConfig
): void {
this.resetSubchannelList();
trace(
Expand Down
2 changes: 1 addition & 1 deletion packages/grpc-js/src/load-balancer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export interface LoadBalancer {
*/
updateAddressList(
addressList: SubchannelAddress[],
lbConfig: LoadBalancingConfig | null,
lbConfig: LoadBalancingConfig,
attributes: { [key: string]: unknown }
): void;
/**
Expand Down

0 comments on commit 7aa9177

Please sign in to comment.