Skip to content

Commit

Permalink
Register listener as child properly
Browse files Browse the repository at this point in the history
  • Loading branch information
murgatroid99 committed Feb 25, 2025
1 parent 1e28a04 commit a9cfd7a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/grpc-js/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,9 @@ export class Server {
if (credentials === null || !(credentials instanceof ServerCredentials)) {
throw new TypeError('creds must be a ServerCredentials object');
}
if (this.channelzEnabled) {
this.listenerChildrenTracker.refChild(channelzRef);
}
const server = this.createHttp2Server(credentials);
const sessionsSet: Set<http2.ServerHttp2Session> = new Set();
this.http2Servers.set(server, {
Expand Down Expand Up @@ -994,9 +997,6 @@ export class Server {
throw new TypeError('creds must be a ServerCredentials object');
}
const channelzRef = this.registerInjectorToChannelz();
if (this.channelzEnabled) {
this.listenerChildrenTracker.refChild(channelzRef);
}
return this.experimentalCreateConnectionInjectorWithChannelzRef(credentials, channelzRef);
}

Expand Down

0 comments on commit a9cfd7a

Please sign in to comment.