Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TransportChannelProvider bean overwrites maxInboundMetadataSize with null #2785

Open
ivan-zaitsev opened this issue Apr 15, 2024 · 3 comments
Labels
priority: p2 type: bug Something isn't working

Comments

@ivan-zaitsev
Copy link

ivan-zaitsev commented Apr 15, 2024

Describe the bug
TransportChannelProvider bean overwrites maxInboundMetadataSize with null by not setting it. It causes io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2Exception: Header size exceeded max allowed size (10240) error because it fallbacks to default 10KiB instead of 4MiB.

Sample
The library has default 4MB:
https://github.com/googleapis/java-pubsub/blob/main/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Subscriber.java#L487

@diegomarquezp
Copy link
Contributor

Hi @ivan-zaitsev, thanks for reporting this issue. Would you mind sharing how you are using the bean and any properties file you are working with? Thanks!

@burkedavison @meltsufin shouldn't a config file override this default setting?

@diegomarquezp diegomarquezp added type: question Further information is requested priority: p2 labels Apr 16, 2024
@ivan-zaitsev
Copy link
Author

ivan-zaitsev commented Apr 16, 2024

Hello @diegomarquezp, default config, default bean.

spring:
  cloud:
    gcp:
      project-id: ...
      credentials:
        encoded-key: ...

You can trace bean TransportChannelProvider usage and will find that it will have maxInboundMetadataSize set to null. It will eventually overwrite it here. But default TransportChannelProvider has that value set to 4MiB.

By some reason SubscriberStubSettings.defaultGrpcTransportProviderBuilder() only sets maxInboundMessageSize.

@meltsufin
Copy link
Member

@diegomarquezp I agree that we should keep the defaults set by Pub/Sub, unless they are overwritten by configuration or we intentionally want to change them in Spring Cloud GCP. In this particular case, we are unintentionally overriding the defaults and should fix it.

@meltsufin meltsufin added type: bug Something isn't working and removed type: question Further information is requested labels Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants