Skip to content

Commit a92ac3d

Browse files
authored
Merge pull request #2547 from murgatroid99/grpc-js_timer_update_1.8.x_actual
grpc-js: Switch Timer type to Timeout (1.8.x)
2 parents 15a3f1a + ec687f6 commit a92ac3d

10 files changed

+15
-15
lines changed

packages/grpc-js/src/backoff-timeout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class BackoffTimeout {
6363
* to an object representing a timer that has ended, but it can still be
6464
* interacted with without error.
6565
*/
66-
private timerId: NodeJS.Timer;
66+
private timerId: NodeJS.Timeout;
6767
/**
6868
* Indicates whether the timer is currently running.
6969
*/

packages/grpc-js/src/internal-channel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export class InternalChannel {
131131
* the invariant is that callRefTimer is reffed if and only if pickQueue
132132
* is non-empty.
133133
*/
134-
private callRefTimer: NodeJS.Timer;
134+
private callRefTimer: NodeJS.Timeout;
135135
private configSelector: ConfigSelector | null = null;
136136
/**
137137
* This is the error from the name resolver if it failed most recently. It

packages/grpc-js/src/load-balancer-outlier-detection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ export class OutlierDetectionLoadBalancer implements LoadBalancer {
367367
private childBalancer: ChildLoadBalancerHandler;
368368
private addressMap: Map<string, MapEntry> = new Map<string, MapEntry>();
369369
private latestConfig: OutlierDetectionLoadBalancingConfig | null = null;
370-
private ejectionTimer: NodeJS.Timer;
370+
private ejectionTimer: NodeJS.Timeout;
371371
private timerStartTime: Date | null = null;
372372

373373
constructor(channelControlHelper: ChannelControlHelper) {

packages/grpc-js/src/resolver-dns.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class DnsResolver implements Resolver {
9696
private defaultResolutionError: StatusObject;
9797
private backoff: BackoffTimeout;
9898
private continueResolving = false;
99-
private nextResolutionTimer: NodeJS.Timer;
99+
private nextResolutionTimer: NodeJS.Timeout;
100100
private isNextResolutionTimerRunning = false;
101101
private isServiceConfigEnabled = true;
102102
constructor(

packages/grpc-js/src/resolving-call.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class ResolvingCall implements Call {
4141
private deadline: Deadline;
4242
private host: string;
4343
private statusWatchers: ((status: StatusObject) => void)[] = [];
44-
private deadlineTimer: NodeJS.Timer = setTimeout(() => {}, 0);
44+
private deadlineTimer: NodeJS.Timeout = setTimeout(() => {}, 0);
4545
private filterStack: FilterStack | null = null;
4646

4747
constructor(

packages/grpc-js/src/retrying-call.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export class RetryingCall implements Call {
169169
* Number of attempts so far
170170
*/
171171
private attempts: number = 0;
172-
private hedgingTimer: NodeJS.Timer | null = null;
172+
private hedgingTimer: NodeJS.Timeout | null = null;
173173
private committedCallIndex: number | null = null;
174174
private initialRetryBackoffSec = 0;
175175
private nextRetryBackoffSec = 0;
@@ -625,7 +625,7 @@ export class RetryingCall implements Call {
625625
return;
626626
}
627627
const call = this.underlyingCalls[this.committedCallIndex];
628-
bufferEntry.callback = context.callback;
628+
bufferEntry.callback = context.callback;
629629
if (call.state === 'ACTIVE' && call.nextMessageToSend === messageIndex) {
630630
call.call.sendMessageWithContext({
631631
callback: (error) => {
@@ -668,4 +668,4 @@ export class RetryingCall implements Call {
668668
getHost(): string {
669669
return this.host;
670670
}
671-
}
671+
}

packages/grpc-js/src/server-call.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ export class Http2ServerCallStream<
407407
ResponseType
408408
> extends EventEmitter {
409409
cancelled = false;
410-
deadlineTimer: NodeJS.Timer | null = null;
410+
deadlineTimer: NodeJS.Timeout | null = null;
411411
private statusSent = false;
412412
private deadline: Deadline = Infinity;
413413
private wantTrailers = false;

packages/grpc-js/src/server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -971,8 +971,8 @@ export class Server {
971971
this.channelzTrace.addTrace('CT_INFO', 'Connection established by client ' + clientAddress);
972972
this.sessionChildrenTracker.refChild(channelzRef);
973973
}
974-
let connectionAgeTimer: NodeJS.Timer | null = null;
975-
let connectionAgeGraceTimer: NodeJS.Timer | null = null;
974+
let connectionAgeTimer: NodeJS.Timeout | null = null;
975+
let connectionAgeGraceTimer: NodeJS.Timeout | null = null;
976976
let sessionClosedByServer = false;
977977
if (this.maxConnectionAgeMs !== UNLIMITED_CONNECTION_AGE_MS) {
978978
// Apply a random jitter within a +/-10% range
@@ -1000,7 +1000,7 @@ export class Server {
10001000
}
10011001
}, this.maxConnectionAgeMs + jitter).unref?.();
10021002
}
1003-
const keeapliveTimeTimer: NodeJS.Timer | null = setInterval(() => {
1003+
const keeapliveTimeTimer: NodeJS.Timeout | null = setInterval(() => {
10041004
const timeoutTImer = setTimeout(() => {
10051005
sessionClosedByServer = true;
10061006
if (this.channelzEnabled) {

packages/grpc-js/src/subchannel-pool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class SubchannelPool {
4545
/**
4646
* A timer of a task performing a periodic subchannel cleanup.
4747
*/
48-
private cleanupTimer: NodeJS.Timer | null = null;
48+
private cleanupTimer: NodeJS.Timeout | null = null;
4949

5050
/**
5151
* A pool of subchannels use for making connections. Subchannels with the

packages/grpc-js/src/transport.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class Http2Transport implements Transport {
8181
/**
8282
* Timer reference for timeout that indicates when to send the next ping
8383
*/
84-
private keepaliveTimerId: NodeJS.Timer | null = null;
84+
private keepaliveTimerId: NodeJS.Timeout | null = null;
8585
/**
8686
* Indicates that the keepalive timer ran out while there were no active
8787
* calls, and a ping should be sent the next time a call starts.
@@ -90,7 +90,7 @@ class Http2Transport implements Transport {
9090
/**
9191
* Timer reference tracking when the most recent ping will be considered lost
9292
*/
93-
private keepaliveTimeoutId: NodeJS.Timer | null = null;
93+
private keepaliveTimeoutId: NodeJS.Timeout | null = null;
9494
/**
9595
* Indicates whether keepalive pings should be sent without any active calls
9696
*/

0 commit comments

Comments
 (0)