grpc-js: Propagate ejection when recreating outlier detection subchannel wrapper

This commit is contained in:
Michael Lumish 2022-08-04 16:02:05 -07:00
parent 78fe8c6d05
commit 001cce7db0
1 changed files with 4 additions and 0 deletions

View File

@ -391,6 +391,10 @@ export class OutlierDetectionLoadBalancer implements LoadBalancer {
const originalSubchannel = channelControlHelper.createSubchannel(subchannelAddress, subchannelArgs);
const mapEntry = this.addressMap.get(subchannelAddressToString(subchannelAddress));
const subchannelWrapper = new OutlierDetectionSubchannelWrapper(originalSubchannel, mapEntry);
if (mapEntry?.currentEjectionTimestamp !== null) {
// If the address is ejected, propagate that to the new subchannel wrapper
subchannelWrapper.eject();
}
mapEntry?.subchannelWrappers.push(subchannelWrapper);
return subchannelWrapper;
},