yoshidan / google-cloud-rust

Google Cloud Client Libraries for Rust.
MIT License
222 stars 80 forks source link

set larger encode/decode message size limits to be consistent with pubsub #152

Closed dezyh closed 1 year ago

dezyh commented 1 year ago

Sets the tonic encode/decode message size limit of both the SubscriberClient (InternalSubscriberClient) and PubisherClient (InternalPublisherClient) to 10MB (10,485,760 bytes). This fixes the reproduction of my issue.

I think PubSub is using 10MB = 10,000,00 as their limit, but it's not disadvantageous to use more than the PubSub limit. We never want to be failing to publish/pull messages due to encoding/decoding failure that PubSub could accept.

Do you think we need to write a test for this? It wouldn't be too hard.

dezyh commented 1 year ago

Keep in mind that this default 4MB limit imposed by tonic v0.9.x is applied to all gRPC requests/responses, so if other services frequently deal with large payloads it might be worth updating those too in the near future.

Thank you for the tracing::error. It made it very easy to debug this after I noticed it was instrumented with tracing.

yoshidan commented 1 year ago

Thank you very much!

Do you think we need to write a test for this? It wouldn't be too hard.

I would appreciate it if you could add it.