-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(node/http2): fixes to support grpc #20712
fix(node/http2): fixes to support grpc #20712
Conversation
@@ -264,7 +271,7 @@ export class Http2Session extends EventEmitter { | |||
} | |||
|
|||
setTimeout(msecs: number, callback?: () => void) { | |||
setStreamTimeout(this, msecs, callback); | |||
setStreamTimeout.call(this, msecs, callback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes problems with setStreamTimeout
that were happening before
@@ -340,6 +352,7 @@ function assertValidPseudoHeader(header: string) { | |||
|
|||
export class ClientHttp2Session extends Http2Session { | |||
#connectPromise: Promise<void>; | |||
#refed = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bit should address #16647
ref() { | ||
this.#refed = true; | ||
if (this[kPollConnPromiseId]) { | ||
core.refOp(this[kPollConnPromiseId]); | ||
} | ||
} | ||
|
||
unref() { | ||
this.#refed = false; | ||
if (this[kPollConnPromiseId]) { | ||
core.unrefOp(this[kPollConnPromiseId]); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto #16647
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This commit improves "node:http2" module implementation, by enabling to use "options.createConnection" callback when starting an HTTP2 session. This change enables to pass basic client-side test with "grpc-js/grpc" package. Smaller fixes like "Http2Session.unref()" and "Http2Session.setTimeout()" were handled as well. Fixes #16647
This commit improves "node:http2" module implementation, by enabling
to use "options.createConnection" callback when starting an HTTP2 session.
This change enables to pass basic client-side test with "grpc-js/grpc" package.
Smaller fixes like "Http2Session.unref()" and "Http2Session.setTimeout()"
were handled as well.
Fixes #16647