standard-ai / ya-gcp

Apache License 2.0
7 stars 8 forks source link

Make PubSub retries more precise #6

Closed rnarubin closed 2 years ago

rnarubin commented 2 years ago

Previously retries in PubSub would only check the status code. Other client libraries like the Java and Go implementations take a further step and parse the error message in some cases to special-case some errors. While I'd typically consider error message parsing a sin, some ideals must be compromised for dealing with real world services.

This additionally reconnects StreamingPull connections if the stream terminates without any error, which is unexpected from PubSub.