grpc-node icon indicating copy to clipboard operation
grpc-node copied to clipboard

Support for `max_metadata_size` in grpc-js

Open 97amarnathk opened this issue 3 years ago • 4 comments

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_size is being used.
  • However the documentation for grpc-jsat npm does not list grpc.max_metadata_size as a valid channel option.
  • This is also not mentioned in ChannelOptions type.

97amarnathk avatar Feb 22 '22 05:02 97amarnathk

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.

murgatroid99 avatar Feb 22 '22 16:02 murgatroid99

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 ?

97amarnathk avatar Feb 23 '22 07:02 97amarnathk

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 avatar Feb 23 '22 16:02 murgatroid99

@murgatroid99 so how should one transport large metadata which exceeds this limit?

darkLord19 avatar Jun 13 '22 12:06 darkLord19