mirror of https://github.com/grpc/grpc-node.git
Fix handling of LRS server name in EDS child config generation
Also add more LRS logging
This commit is contained in:
parent
76f4e3fef4
commit
5ef5246375
|
@ -377,7 +377,7 @@ export class EdsLoadBalancer implements LoadBalancer {
|
|||
validateLoadBalancingConfig({ round_robin: {} }),
|
||||
];
|
||||
let childPolicy: LoadBalancingConfig[];
|
||||
if (this.lastestConfig.getLrsLoadReportingServerName()) {
|
||||
if (this.lastestConfig.getLrsLoadReportingServerName() !== undefined) {
|
||||
childPolicy = [new LrsLoadBalancingConfig(this.lastestConfig.getCluster(), this.lastestConfig.getEdsServiceName() ?? '', this.lastestConfig.getLrsLoadReportingServerName()!, localityObj.locality, endpointPickingPolicy)];
|
||||
} else {
|
||||
childPolicy = endpointPickingPolicy;
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
|
||||
import { connectivityState as ConnectivityState, StatusObject, status as Status, experimental } from '@grpc/grpc-js';
|
||||
import { type } from 'os';
|
||||
import { Locality__Output } from './generated/envoy/api/v2/core/Locality';
|
||||
import { XdsClusterLocalityStats, XdsClient, getSingletonXdsClient } from './xds-client';
|
||||
import LoadBalancer = experimental.LoadBalancer;
|
||||
|
|
|
@ -751,6 +751,7 @@ export class XdsClient {
|
|||
clusterName: string,
|
||||
edsServiceName: string
|
||||
): XdsClusterDropStats {
|
||||
trace('addClusterDropStats(lrsServer=' + lrsServer + ', clusterName=' + clusterName + ', edsServiceName=' + edsServiceName + ')');
|
||||
if (lrsServer !== '') {
|
||||
return {
|
||||
addCallDropped: (category) => {},
|
||||
|
@ -774,6 +775,7 @@ export class XdsClient {
|
|||
edsServiceName: string,
|
||||
locality: Locality__Output
|
||||
): XdsClusterLocalityStats {
|
||||
trace('addClusterLocalityStats(lrsServer=' + lrsServer + ', clusterName=' + clusterName + ', edsServiceName=' + edsServiceName + ', locality=' + JSON.stringify(locality) + ')');
|
||||
if (lrsServer !== '') {
|
||||
return {
|
||||
addCallStarted: () => {},
|
||||
|
|
Loading…
Reference in New Issue