mirror of https://github.com/grpc/grpc-node.git
grpc-js: Switch Timer type to Timeout (1.8.x)
This commit is contained in:
parent
15a3f1a31c
commit
ec687f6fb1
|
|
@ -63,7 +63,7 @@ export class BackoffTimeout {
|
||||||
* to an object representing a timer that has ended, but it can still be
|
* to an object representing a timer that has ended, but it can still be
|
||||||
* interacted with without error.
|
* interacted with without error.
|
||||||
*/
|
*/
|
||||||
private timerId: NodeJS.Timer;
|
private timerId: NodeJS.Timeout;
|
||||||
/**
|
/**
|
||||||
* Indicates whether the timer is currently running.
|
* Indicates whether the timer is currently running.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ export class InternalChannel {
|
||||||
* the invariant is that callRefTimer is reffed if and only if pickQueue
|
* the invariant is that callRefTimer is reffed if and only if pickQueue
|
||||||
* is non-empty.
|
* is non-empty.
|
||||||
*/
|
*/
|
||||||
private callRefTimer: NodeJS.Timer;
|
private callRefTimer: NodeJS.Timeout;
|
||||||
private configSelector: ConfigSelector | null = null;
|
private configSelector: ConfigSelector | null = null;
|
||||||
/**
|
/**
|
||||||
* This is the error from the name resolver if it failed most recently. It
|
* This is the error from the name resolver if it failed most recently. It
|
||||||
|
|
|
||||||
|
|
@ -367,7 +367,7 @@ export class OutlierDetectionLoadBalancer implements LoadBalancer {
|
||||||
private childBalancer: ChildLoadBalancerHandler;
|
private childBalancer: ChildLoadBalancerHandler;
|
||||||
private addressMap: Map<string, MapEntry> = new Map<string, MapEntry>();
|
private addressMap: Map<string, MapEntry> = new Map<string, MapEntry>();
|
||||||
private latestConfig: OutlierDetectionLoadBalancingConfig | null = null;
|
private latestConfig: OutlierDetectionLoadBalancingConfig | null = null;
|
||||||
private ejectionTimer: NodeJS.Timer;
|
private ejectionTimer: NodeJS.Timeout;
|
||||||
private timerStartTime: Date | null = null;
|
private timerStartTime: Date | null = null;
|
||||||
|
|
||||||
constructor(channelControlHelper: ChannelControlHelper) {
|
constructor(channelControlHelper: ChannelControlHelper) {
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ class DnsResolver implements Resolver {
|
||||||
private defaultResolutionError: StatusObject;
|
private defaultResolutionError: StatusObject;
|
||||||
private backoff: BackoffTimeout;
|
private backoff: BackoffTimeout;
|
||||||
private continueResolving = false;
|
private continueResolving = false;
|
||||||
private nextResolutionTimer: NodeJS.Timer;
|
private nextResolutionTimer: NodeJS.Timeout;
|
||||||
private isNextResolutionTimerRunning = false;
|
private isNextResolutionTimerRunning = false;
|
||||||
private isServiceConfigEnabled = true;
|
private isServiceConfigEnabled = true;
|
||||||
constructor(
|
constructor(
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ export class ResolvingCall implements Call {
|
||||||
private deadline: Deadline;
|
private deadline: Deadline;
|
||||||
private host: string;
|
private host: string;
|
||||||
private statusWatchers: ((status: StatusObject) => void)[] = [];
|
private statusWatchers: ((status: StatusObject) => void)[] = [];
|
||||||
private deadlineTimer: NodeJS.Timer = setTimeout(() => {}, 0);
|
private deadlineTimer: NodeJS.Timeout = setTimeout(() => {}, 0);
|
||||||
private filterStack: FilterStack | null = null;
|
private filterStack: FilterStack | null = null;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ export class RetryingCall implements Call {
|
||||||
* Number of attempts so far
|
* Number of attempts so far
|
||||||
*/
|
*/
|
||||||
private attempts: number = 0;
|
private attempts: number = 0;
|
||||||
private hedgingTimer: NodeJS.Timer | null = null;
|
private hedgingTimer: NodeJS.Timeout | null = null;
|
||||||
private committedCallIndex: number | null = null;
|
private committedCallIndex: number | null = null;
|
||||||
private initialRetryBackoffSec = 0;
|
private initialRetryBackoffSec = 0;
|
||||||
private nextRetryBackoffSec = 0;
|
private nextRetryBackoffSec = 0;
|
||||||
|
|
@ -625,7 +625,7 @@ export class RetryingCall implements Call {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const call = this.underlyingCalls[this.committedCallIndex];
|
const call = this.underlyingCalls[this.committedCallIndex];
|
||||||
bufferEntry.callback = context.callback;
|
bufferEntry.callback = context.callback;
|
||||||
if (call.state === 'ACTIVE' && call.nextMessageToSend === messageIndex) {
|
if (call.state === 'ACTIVE' && call.nextMessageToSend === messageIndex) {
|
||||||
call.call.sendMessageWithContext({
|
call.call.sendMessageWithContext({
|
||||||
callback: (error) => {
|
callback: (error) => {
|
||||||
|
|
@ -668,4 +668,4 @@ export class RetryingCall implements Call {
|
||||||
getHost(): string {
|
getHost(): string {
|
||||||
return this.host;
|
return this.host;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -407,7 +407,7 @@ export class Http2ServerCallStream<
|
||||||
ResponseType
|
ResponseType
|
||||||
> extends EventEmitter {
|
> extends EventEmitter {
|
||||||
cancelled = false;
|
cancelled = false;
|
||||||
deadlineTimer: NodeJS.Timer | null = null;
|
deadlineTimer: NodeJS.Timeout | null = null;
|
||||||
private statusSent = false;
|
private statusSent = false;
|
||||||
private deadline: Deadline = Infinity;
|
private deadline: Deadline = Infinity;
|
||||||
private wantTrailers = false;
|
private wantTrailers = false;
|
||||||
|
|
|
||||||
|
|
@ -971,8 +971,8 @@ export class Server {
|
||||||
this.channelzTrace.addTrace('CT_INFO', 'Connection established by client ' + clientAddress);
|
this.channelzTrace.addTrace('CT_INFO', 'Connection established by client ' + clientAddress);
|
||||||
this.sessionChildrenTracker.refChild(channelzRef);
|
this.sessionChildrenTracker.refChild(channelzRef);
|
||||||
}
|
}
|
||||||
let connectionAgeTimer: NodeJS.Timer | null = null;
|
let connectionAgeTimer: NodeJS.Timeout | null = null;
|
||||||
let connectionAgeGraceTimer: NodeJS.Timer | null = null;
|
let connectionAgeGraceTimer: NodeJS.Timeout | null = null;
|
||||||
let sessionClosedByServer = false;
|
let sessionClosedByServer = false;
|
||||||
if (this.maxConnectionAgeMs !== UNLIMITED_CONNECTION_AGE_MS) {
|
if (this.maxConnectionAgeMs !== UNLIMITED_CONNECTION_AGE_MS) {
|
||||||
// Apply a random jitter within a +/-10% range
|
// Apply a random jitter within a +/-10% range
|
||||||
|
|
@ -1000,7 +1000,7 @@ export class Server {
|
||||||
}
|
}
|
||||||
}, this.maxConnectionAgeMs + jitter).unref?.();
|
}, this.maxConnectionAgeMs + jitter).unref?.();
|
||||||
}
|
}
|
||||||
const keeapliveTimeTimer: NodeJS.Timer | null = setInterval(() => {
|
const keeapliveTimeTimer: NodeJS.Timeout | null = setInterval(() => {
|
||||||
const timeoutTImer = setTimeout(() => {
|
const timeoutTImer = setTimeout(() => {
|
||||||
sessionClosedByServer = true;
|
sessionClosedByServer = true;
|
||||||
if (this.channelzEnabled) {
|
if (this.channelzEnabled) {
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ export class SubchannelPool {
|
||||||
/**
|
/**
|
||||||
* A timer of a task performing a periodic subchannel cleanup.
|
* A timer of a task performing a periodic subchannel cleanup.
|
||||||
*/
|
*/
|
||||||
private cleanupTimer: NodeJS.Timer | null = null;
|
private cleanupTimer: NodeJS.Timeout | null = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A pool of subchannels use for making connections. Subchannels with the
|
* A pool of subchannels use for making connections. Subchannels with the
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ class Http2Transport implements Transport {
|
||||||
/**
|
/**
|
||||||
* Timer reference for timeout that indicates when to send the next ping
|
* Timer reference for timeout that indicates when to send the next ping
|
||||||
*/
|
*/
|
||||||
private keepaliveTimerId: NodeJS.Timer | null = null;
|
private keepaliveTimerId: NodeJS.Timeout | null = null;
|
||||||
/**
|
/**
|
||||||
* Indicates that the keepalive timer ran out while there were no active
|
* Indicates that the keepalive timer ran out while there were no active
|
||||||
* calls, and a ping should be sent the next time a call starts.
|
* calls, and a ping should be sent the next time a call starts.
|
||||||
|
|
@ -90,7 +90,7 @@ class Http2Transport implements Transport {
|
||||||
/**
|
/**
|
||||||
* Timer reference tracking when the most recent ping will be considered lost
|
* Timer reference tracking when the most recent ping will be considered lost
|
||||||
*/
|
*/
|
||||||
private keepaliveTimeoutId: NodeJS.Timer | null = null;
|
private keepaliveTimeoutId: NodeJS.Timeout | null = null;
|
||||||
/**
|
/**
|
||||||
* Indicates whether keepalive pings should be sent without any active calls
|
* Indicates whether keepalive pings should be sent without any active calls
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue