googleapis / python-firestore

Apache License 2.0
219 stars 75 forks source link

Fix query stream resumption #889

Open daniel-sanche opened 8 months ago

daniel-sanche commented 8 months ago

RunQuery and RunAggregationQuery are stream rpcs, meaning they return a generator that can be yielded from.

They currently both have some logic in place to detect when an exception is raised, and attempt to silently re-start the stream when it fails, while still presenting the user with a unified generator (RunQuery, RunAggregationQuery implementation)

Unfortunately, these implementations don't modify the query request, meaning the user yeilding from the generator will see repeated results, with no indication taht anything went wrong

We should replace this custom logic with the new streaming retries functionality in api_core, and make sure stream errors are handled cleanly

daniel-sanche commented 5 months ago

This is part of the larger retry cleanup work: https://github.com/googleapis/python-firestore/milestone/4