Merge pull request #2864 from rickihastings/patch/configurable-http2-initial-window-size

feat(grpc-js): allow configurable http2 initial window size
This commit is contained in:
Michael Lumish 2025-01-08 14:42:46 -08:00 committed by GitHub
commit 5b0956a9df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 0 deletions

View File

@ -70,6 +70,7 @@ Many channel arguments supported in `grpc` are not supported in `@grpc/grpc-js`.
- `grpc-node.max_session_memory`
- `grpc-node.tls_enable_trace`
- `grpc-node.retry_max_attempts_limit`
- `grpc-node.flow_control_window`
- `channelOverride`
- `channelFactoryOverride`

View File

@ -64,6 +64,7 @@ export interface ChannelOptions {
'grpc-node.tls_enable_trace'?: number;
'grpc.lb.ring_hash.ring_size_cap'?: number;
'grpc-node.retry_max_attempts_limit'?: number;
'grpc-node.flow_control_window'?: number;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
}
@ -101,6 +102,7 @@ export const recognizedOptions = {
'grpc-node.tls_enable_trace': true,
'grpc.lb.ring_hash.ring_size_cap': true,
'grpc-node.retry_max_attempts_limit': true,
'grpc-node.flow_control_window': true,
};
export function channelOptionsEqual(

View File

@ -673,6 +673,11 @@ export class Http2SubchannelConnector implements SubchannelConnector {
const session = http2.connect(`http://${targetPath}`, {
createConnection: (authority, option) => {
return underlyingConnection;
},
settings: {
initialWindowSize:
options['grpc-node.flow_control_window'] ??
http2.getDefaultSettings().initialWindowSize,
}
});
this.session = session;