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

Update quantum_run_stream to not prefetch first result #5024

Merged
merged 2 commits into from Feb 25, 2022

Conversation

maffoo
Copy link
Contributor

@maffoo maffoo commented Feb 25, 2022

Prefetching doesn't work because the service does not send any messages until after the user has sent at least one request. It seems prefetching was added in gapic 1.17.0 and broke some other streaming APIs such as pubsub (googleapis/python-api-core#25). This changes follows the official workaround, which is unfortunately pretty hacky (googleapis/python-api-core#30).

@wcourtney, @verult

@maffoo maffoo requested a review from viathor February 25, 2022 07:55
@CirqBot CirqBot added the Size: XS <10 lines changed label Feb 25, 2022
@MichaelBroughton
Copy link
Collaborator

Will we need to add this in everytime we regenerate these files with a different gapic version ?

@maffoo
Copy link
Contributor Author

maffoo commented Feb 25, 2022

Will we need to add this in everytime we regenerate these files with a different gapic version ?

AFAICT, yes, unless it gets fixed by gapic; the code generation allows configuring things like default timeouts and retry parameters for each rpc, but not this prefetching flag. I don't think regeneration happens very often, but if we have instructions on the procedure we'd want to include this hack with the instructions.

@wcourtney
Copy link
Collaborator

I'll add a comment to the existing documentation and reference this PR.

Copy link
Collaborator

@wcourtney wcourtney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes that looks like a pain to find. Thanks for digging into this, Matt!

@maffoo maffoo merged commit a9e6e4e into master Feb 25, 2022
@maffoo maffoo deleted the u/maffoo/stream-prefetch branch February 25, 2022 21:41
95-martin-orion pushed a commit to 95-martin-orion/Cirq that referenced this pull request Mar 2, 2022
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: XS <10 lines changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants