Support for `max_metadata_size` in grpc-js
Problem description
Is grpc.max_metadata_size supported in grpc-js ?
If so, then what is the maximum allowed value for this ?
Environment
- OS name, version and architecture: [e.g. MacOS Monterey 12.0.1]
- Node version 14.17.4
- Node installation method nvm
- Package name and version
@grpc/grpc-js:^1.5.5
Additional context
- I have migrated from "grpc" to "grpc-js".
- On going through the interop tests here, I noticed that
grpc.max_metadata_sizeis being used. - However the documentation for
grpc-jsat npm does not listgrpc.max_metadata_sizeas a valid channel option. - This is also not mentioned in
ChannelOptionstype.
No, that option is not supported. No limit is enforced in grpc-js, so the practical limit is whatever maximum value Node itself supports. The test in the linked PR applies to both libraries so it needs to set the option for the other library. However, that test is also currently skipped because it does not work.
Okay. Also a related doubt. Is GRPC metadata passed as a http header in the first frame ? If so the max size permitted for metadata will be equal to max http header size allowed by nodejs, correct ?
gRPC metadata is transformed directly into HTTP/2 headers. There are some headers that gRPC itself sets, so you can't go right to the limit with metadata, but you can get close. The specific framing happens at a lower level and probably doesn't meaningfully affect the limit.
@murgatroid99 so how should one transport large metadata which exceeds this limit?