You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every subsequent call to someGrpcCall will contain one extra token header until the header grows so big that you get an exception Header size exceeded max allowed size (8192).
The reason is that here in grpc-java the origHeaders is a mutable object and our requestHeaders above are getting merged into it. And in the stub code we have ClientCall(channel, MyServiceApi.METHOD_SOME_GRPC_CALL, opts).unaryToUnaryCall(request, metadata). The metadata here gets reused on every subsequent call, and every time the MetadataApplier mutates it.
I think the stub implementation should be something like this to make it safe:
We have an interceptor that works like this:
Now when we have a stub
service
with this interceptor applied to its channel:Every subsequent call to
someGrpcCall
will contain one extra token header until the header grows so big that you get an exceptionHeader size exceeded max allowed size (8192)
.The reason is that here in grpc-java the
origHeaders
is a mutable object and ourrequestHeaders
above are getting merged into it. And in the stub code we haveClientCall(channel, MyServiceApi.METHOD_SOME_GRPC_CALL, opts).unaryToUnaryCall(request, metadata)
. Themetadata
here gets reused on every subsequent call, and every time theMetadataApplier
mutates it.I think the stub implementation should be something like this to make it safe:
The text was updated successfully, but these errors were encountered: