mirror of https://github.com/grpc/grpc-node.git
Merge branch 'master' into grpc-js_credentials_secure_connector
This commit is contained in:
commit
165732467d
|
@ -37,7 +37,7 @@
|
|||
"@types/gulp": "^4.0.6",
|
||||
"@types/gulp-mocha": "0.0.32",
|
||||
"@types/mocha": "^5.2.6",
|
||||
"@types/node": "^13.11.1",
|
||||
"@types/node": ">=20.11.20",
|
||||
"@types/yargs": "^15.0.5",
|
||||
"find-free-ports": "^3.1.1",
|
||||
"gts": "^5.0.1",
|
||||
|
|
|
@ -184,8 +184,8 @@ export class PriorityLoadBalancer implements LoadBalancer {
|
|||
private connectivityState: ConnectivityState = ConnectivityState.IDLE;
|
||||
private picker: Picker;
|
||||
private childBalancer: ChildLoadBalancerHandler;
|
||||
private failoverTimer: NodeJS.Timer | null = null;
|
||||
private deactivationTimer: NodeJS.Timer | null = null;
|
||||
private failoverTimer: NodeJS.Timeout | null = null;
|
||||
private deactivationTimer: NodeJS.Timeout | null = null;
|
||||
private seenReadyOrIdleSinceTransientFailure = false;
|
||||
constructor(private parent: PriorityLoadBalancer, private name: string, ignoreReresolutionRequests: boolean) {
|
||||
this.childBalancer = new ChildLoadBalancerHandler(experimental.createChildChannelControlHelper(this.parent.channelControlHelper, {
|
||||
|
|
|
@ -170,7 +170,7 @@ export class WeightedTargetLoadBalancer implements LoadBalancer {
|
|||
private connectivityState: ConnectivityState = ConnectivityState.IDLE;
|
||||
private picker: Picker;
|
||||
private childBalancer: ChildLoadBalancerHandler;
|
||||
private deactivationTimer: NodeJS.Timer | null = null;
|
||||
private deactivationTimer: NodeJS.Timeout | null = null;
|
||||
private weight: number = 0;
|
||||
|
||||
constructor(private parent: WeightedTargetLoadBalancer, private name: string) {
|
||||
|
|
|
@ -493,7 +493,7 @@ interface MatchFieldEvaluator<MatcherType, FieldType> {
|
|||
isMoreSpecific: (matcher1: MatcherType, matcher2: MatcherType) => boolean;
|
||||
}
|
||||
|
||||
type FieldType<MatcherType> = MatcherType extends CidrRange ? (string | undefined) : MatcherType extends (ConnectionSourceType) ? {localAddress: string, remoteAddress?: (string | undefined)} : MatcherType extends number ? number | undefined : never;
|
||||
type FieldType<MatcherType> = MatcherType extends CidrRange ? (string | undefined) : MatcherType extends (ConnectionSourceType) ? {localAddress?: (string | undefined), remoteAddress?: (string | undefined)} : MatcherType extends number ? number | undefined : never;
|
||||
|
||||
function cidrRangeMatch(range: CidrRange | undefined, address: string | undefined): boolean {
|
||||
return !range || (!!address && inCidrRange(range, address));
|
||||
|
@ -506,14 +506,14 @@ function cidrRangeMoreSpecific(range1: CidrRange | undefined, range2: CidrRange
|
|||
return !!range1 && range1.prefixLen > range2.prefixLen;
|
||||
}
|
||||
|
||||
function sourceTypeMatch(sourceType: ConnectionSourceType, addresses: {localAddress: string, remoteAddress?: (string | undefined)}): boolean {
|
||||
function sourceTypeMatch(sourceType: ConnectionSourceType, addresses: {localAddress?: (string | undefined), remoteAddress?: (string | undefined)}): boolean {
|
||||
switch (sourceType) {
|
||||
case "ANY":
|
||||
return true;
|
||||
case "SAME_IP_OR_LOOPBACK":
|
||||
return !!addresses.remoteAddress && isSameIpOrLoopback(addresses.remoteAddress, addresses.localAddress);
|
||||
return !!addresses.localAddress && !!addresses.remoteAddress && isSameIpOrLoopback(addresses.remoteAddress, addresses.localAddress);
|
||||
case "EXTERNAL":
|
||||
return !!addresses.remoteAddress && !isSameIpOrLoopback(addresses.remoteAddress, addresses.localAddress);
|
||||
return !!addresses.localAddress && !!addresses.remoteAddress && !isSameIpOrLoopback(addresses.remoteAddress, addresses.localAddress);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -523,7 +523,7 @@ const cidrRangeEvaluator: MatchFieldEvaluator<CidrRange | undefined, string | un
|
|||
isMoreSpecific: cidrRangeMoreSpecific
|
||||
};
|
||||
|
||||
const sourceTypeEvaluator: MatchFieldEvaluator<ConnectionSourceType, {localAddress: string, remoteAddress?: (string | undefined)}> = {
|
||||
const sourceTypeEvaluator: MatchFieldEvaluator<ConnectionSourceType, {localAddress?: (string | undefined), remoteAddress?: (string | undefined)}> = {
|
||||
isMatch: sourceTypeMatch,
|
||||
matcherEqual: (matcher1, matcher2) => matcher1 === matcher2,
|
||||
isMoreSpecific: (matcher1, matcher2) => matcher1 !== 'ANY' && matcher2 === 'ANY'
|
||||
|
|
|
@ -104,7 +104,7 @@ export class Watcher<UpdateType> implements ResourceWatcherInterface {
|
|||
const RESOURCE_TIMEOUT_MS = 15_000;
|
||||
|
||||
class ResourceTimer {
|
||||
private timer: NodeJS.Timer | null = null;
|
||||
private timer: NodeJS.Timeout | null = null;
|
||||
private resourceSeen = false;
|
||||
constructor(private callState: AdsCallState, private type: XdsResourceType, private name: XdsResourceName) {}
|
||||
|
||||
|
@ -673,7 +673,7 @@ class ClusterLoadReportMap {
|
|||
}
|
||||
|
||||
class LrsCallState {
|
||||
private statsTimer: NodeJS.Timer | null = null;
|
||||
private statsTimer: NodeJS.Timeout | null = null;
|
||||
private sentInitialMessage = false;
|
||||
constructor(private client: XdsSingleServerClient, private call: LrsCall, private node: Node) {
|
||||
call.on('data', (message: LoadStatsResponse__Output) => {
|
||||
|
|
|
@ -42,7 +42,7 @@ const BOOTSTRAP_CONFIG_KEY = 'grpc.TEST_ONLY_DO_NOT_USE_IN_PROD.xds_bootstrap_co
|
|||
|
||||
export class XdsTestClient {
|
||||
private client: EchoTestServiceClient;
|
||||
private callInterval: NodeJS.Timer;
|
||||
private callInterval: NodeJS.Timeout;
|
||||
|
||||
constructor(target: string, bootstrapInfo: string, creds?: ChannelCredentials | undefined, options?: ChannelOptions) {
|
||||
this.client = new loadedProtos.grpc.testing.EchoTestService(target, creds ?? credentials.createInsecure(), {...options, [BOOTSTRAP_CONFIG_KEY]: bootstrapInfo});
|
||||
|
|
Loading…
Reference in New Issue