mirror of https://github.com/grpc/grpc-node.git
fix: allow configurable http2 initial window size. fixes #2429
This commit is contained in:
parent
8f08bbe621
commit
d08318d8c1
|
@ -70,6 +70,7 @@ Many channel arguments supported in `grpc` are not supported in `@grpc/grpc-js`.
|
||||||
- `grpc-node.max_session_memory`
|
- `grpc-node.max_session_memory`
|
||||||
- `grpc-node.tls_enable_trace`
|
- `grpc-node.tls_enable_trace`
|
||||||
- `grpc-node.retry_max_attempts_limit`
|
- `grpc-node.retry_max_attempts_limit`
|
||||||
|
- `grpc-node.http2_initial_window_size`
|
||||||
- `channelOverride`
|
- `channelOverride`
|
||||||
- `channelFactoryOverride`
|
- `channelFactoryOverride`
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,7 @@ export interface ChannelOptions {
|
||||||
'grpc-node.tls_enable_trace'?: number;
|
'grpc-node.tls_enable_trace'?: number;
|
||||||
'grpc.lb.ring_hash.ring_size_cap'?: number;
|
'grpc.lb.ring_hash.ring_size_cap'?: number;
|
||||||
'grpc-node.retry_max_attempts_limit'?: number;
|
'grpc-node.retry_max_attempts_limit'?: number;
|
||||||
|
'grpc-node.http2_initial_window_size'?: number;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
@ -101,6 +102,7 @@ export const recognizedOptions = {
|
||||||
'grpc-node.tls_enable_trace': true,
|
'grpc-node.tls_enable_trace': true,
|
||||||
'grpc.lb.ring_hash.ring_size_cap': true,
|
'grpc.lb.ring_hash.ring_size_cap': true,
|
||||||
'grpc-node.retry_max_attempts_limit': true,
|
'grpc-node.retry_max_attempts_limit': true,
|
||||||
|
'grpc-node.http2_initial_window_size': true,
|
||||||
};
|
};
|
||||||
|
|
||||||
export function channelOptionsEqual(
|
export function channelOptionsEqual(
|
||||||
|
|
|
@ -672,6 +672,11 @@ export class Http2SubchannelConnector implements SubchannelConnector {
|
||||||
const session = http2.connect(`http://${targetPath}`, {
|
const session = http2.connect(`http://${targetPath}`, {
|
||||||
createConnection: (authority, option) => {
|
createConnection: (authority, option) => {
|
||||||
return underlyingConnection;
|
return underlyingConnection;
|
||||||
|
},
|
||||||
|
settings: {
|
||||||
|
initialWindowSize:
|
||||||
|
options['grpc-node.http2_initial_window_size'] ||
|
||||||
|
http2.getDefaultSettings().initialWindowSize,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.session = session;
|
this.session = session;
|
||||||
|
|
Loading…
Reference in New Issue