René's URL Explorer Experiment


Title: feat: allow disabling response stream pre-fetch by plamut · Pull Request #30 · googleapis/python-api-core · GitHub

Open Graph Title: feat: allow disabling response stream pre-fetch by plamut · Pull Request #30 · googleapis/python-api-core

X Title: feat: allow disabling response stream pre-fetch by plamut · Pull Request #30 · googleapis/python-api-core

Description: Closes #25. This PR adds the ability to disable automatically pre-fetching the first item of a stream returned by *-Stream gRPC callables. This hook will be used in PubSub to fix the stalled stream issue, while also not affecting Firestore, since the default behavior is preserved. I realize the fix is far from ideal, but it's the least ugly among the approaches I tried, e.g. somehow passing the flag through ResumableBidiRpc (it's a messy rabbit hole). On the PubSub side monkeypatching the generated SubscriberClient will be needed, but it's a (relatively) clean one-liner: diff --git google/cloud/pubsub_v1/gapic/subscriber_client.py google/cloud/pubsub_v1/gapic/subscriber_client.py index e98a686..1d6c058 100644 --- google/cloud/pubsub_v1/gapic/subscriber_client.py +++ google/cloud/pubsub_v1/gapic/subscriber_client.py @@ -1169,6 +1169,8 @@ class SubscriberClient(object): default_timeout=self._method_configs["StreamingPull"].timeout, client_info=self._client_info, ) + # TODO: explain this monkeypatch! + self.transport.streaming_pull._prefetch_first_result_ = False return self._inner_api_calls["streaming_pull"]( requests, retry=retry, timeout=timeout, metadata=metadata If/when we merge this, we should also release it, and then we can add != 1.17.0 to the google-api-core version pin in PubSub. PR checklist Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea Ensure the tests and linter pass Code coverage does not decrease (if any source code was changed) Appropriate docs were updated (if necessary)

Open Graph Description: Closes #25. This PR adds the ability to disable automatically pre-fetching the first item of a stream returned by *-Stream gRPC callables. This hook will be used in PubSub to fix the stalled stream...

X Description: Closes #25. This PR adds the ability to disable automatically pre-fetching the first item of a stream returned by *-Stream gRPC callables. This hook will be used in PubSub to fix the stalled stream...

Opengraph URL: https://github.com/googleapis/python-api-core/pull/30

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:61427f3d-ff4d-390a-5a96-9e7f59366211
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCF8C:286F17:3A0384:4E019A:6A4D9FA3
html-safe-noncef7392f6ab9f3d802d2b83c6d77fd0c322127136e2ff43c440ee09658e7fb985c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjhDOjI4NkYxNzozQTAzODQ6NEUwMTlBOjZBNEQ5RkEzIiwidmlzaXRvcl9pZCI6IjI4MzYxNTk2NzQwNTQ0NTExMDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac4ff7d7f09235998c4ede503bec09c211c17facfc345fde92e86ae2e87cd7dea0
hovercard-subject-tagpull_request:421371060
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/googleapis/python-api-core/pull/30/files
twitter:imagehttps://avatars.githubusercontent.com/u/1235663?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1235663?s=400&v=4
og:image:altCloses #25. This PR adds the ability to disable automatically pre-fetching the first item of a stream returned by *-Stream gRPC callables. This hook will be used in PubSub to fix the stalled stream...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/googleapis/python-api-core git https://github.com/googleapis/python-api-core.git
octolytics-dimension-user_id16785467
octolytics-dimension-user_logingoogleapis
octolytics-dimension-repository_id226992456
octolytics-dimension-repository_nwogoogleapis/python-api-core
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id226992456
octolytics-dimension-repository_network_root_nwogoogleapis/python-api-core
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7f13faa65cccc9b729d674da83335d5dcfdfd193
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/googleapis/python-api-core/pull/30/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fpython-api-core%2Fpull%2F30%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fpython-api-core%2Fpull%2F30%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=googleapis%2Fpython-api-core
Reloadhttps://github.com/googleapis/python-api-core/pull/30/files
Reloadhttps://github.com/googleapis/python-api-core/pull/30/files
Reloadhttps://github.com/googleapis/python-api-core/pull/30/files
Please reload this pagehttps://github.com/googleapis/python-api-core/pull/30/files
googleapis https://github.com/googleapis
python-api-corehttps://github.com/googleapis/python-api-core
Notifications https://github.com/login?return_to=%2Fgoogleapis%2Fpython-api-core
Fork 97 https://github.com/login?return_to=%2Fgoogleapis%2Fpython-api-core
Star 144 https://github.com/login?return_to=%2Fgoogleapis%2Fpython-api-core
Code https://github.com/googleapis/python-api-core
Issues 0 https://github.com/googleapis/python-api-core/issues
Pull requests 0 https://github.com/googleapis/python-api-core/pulls
Actions https://github.com/googleapis/python-api-core/actions
Projects https://github.com/googleapis/python-api-core/projects
Security and quality 0 https://github.com/googleapis/python-api-core/security
Insights https://github.com/googleapis/python-api-core/pulse
Code https://github.com/googleapis/python-api-core
Issues https://github.com/googleapis/python-api-core/issues
Pull requests https://github.com/googleapis/python-api-core/pulls
Actions https://github.com/googleapis/python-api-core/actions
Projects https://github.com/googleapis/python-api-core/projects
Security and quality https://github.com/googleapis/python-api-core/security
Insights https://github.com/googleapis/python-api-core/pulse
gcf-merge-on-greenhttps://github.com/apps/gcf-merge-on-green
googleapis:masterhttps://github.com/googleapis/python-api-core/tree/master
plamut:iss-25https://github.com/plamut/python-api-core/tree/iss-25
Conversation 8 https://github.com/googleapis/python-api-core/pull/30
Commits 5 https://github.com/googleapis/python-api-core/pull/30/commits
Checks 0 https://github.com/googleapis/python-api-core/pull/30/checks
Files changed https://github.com/googleapis/python-api-core/pull/30/files
Please reload this pagehttps://github.com/googleapis/python-api-core/pull/30/files
feat: allow disabling response stream pre-fetch https://github.com/googleapis/python-api-core/pull/30/files#top
Show all changes 5 commits https://github.com/googleapis/python-api-core/pull/30/files
6743b28 feat: allow disabling response stream pre-fetch plamut May 21, 2020 https://github.com/googleapis/python-api-core/pull/30/commits/6743b2865650520a942d0aafbdbc12b47c295cb8
78bb304 Merge branch 'master' into iss-25 plamut Jun 3, 2020 https://github.com/googleapis/python-api-core/pull/30/commits/78bb304a038b4aa2b2a9e04502f8487c9ecd13ef
501c22d Merge branch 'master' into iss-25 plamut Jun 5, 2020 https://github.com/googleapis/python-api-core/pull/30/commits/501c22de8b951e09977cad817e14005d31d09872
127e161 Merge branch 'master' into iss-25 plamut Jun 6, 2020 https://github.com/googleapis/python-api-core/pull/30/commits/127e16132918ac1b84bc3cd4751cd4c20d844bd0
b06c03c Merge branch 'master' into iss-25 crwilcox Jun 9, 2020 https://github.com/googleapis/python-api-core/pull/30/commits/b06c03c97eaede01b8f42eea185336b7e4ac9cdf
Clear filters https://github.com/googleapis/python-api-core/pull/30/files
Please reload this pagehttps://github.com/googleapis/python-api-core/pull/30/files
Please reload this pagehttps://github.com/googleapis/python-api-core/pull/30/files
grpc_helpers.py https://github.com/googleapis/python-api-core/pull/30/files#diff-9aeb5107dac746ab0e51a30c001ca48df095ca511bc881c40ed0c5e71cf7dc73
test_grpc_helpers.py https://github.com/googleapis/python-api-core/pull/30/files#diff-a2ab7509503191e922431f02fd347dd02debe706b046872c0ee6f41785fd0acb
google/api_core/grpc_helpers.pyhttps://github.com/googleapis/python-api-core/pull/30/files#diff-9aeb5107dac746ab0e51a30c001ca48df095ca511bc881c40ed0c5e71cf7dc73
View file https://github.com/plamut/python-api-core/blob/b06c03c97eaede01b8f42eea185336b7e4ac9cdf/google/api_core/grpc_helpers.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/googleapis/python-api-core/pull/30/{{ revealButtonHref }}
https://github.com/googleapis/python-api-core/pull/30/files#diff-9aeb5107dac746ab0e51a30c001ca48df095ca511bc881c40ed0c5e71cf7dc73
https://github.com/googleapis/python-api-core/pull/30/files#diff-9aeb5107dac746ab0e51a30c001ca48df095ca511bc881c40ed0c5e71cf7dc73
https://github.com/googleapis/python-api-core/pull/30/files#diff-9aeb5107dac746ab0e51a30c001ca48df095ca511bc881c40ed0c5e71cf7dc73
https://github.com/googleapis/python-api-core/pull/30/files#diff-9aeb5107dac746ab0e51a30c001ca48df095ca511bc881c40ed0c5e71cf7dc73
tests/unit/test_grpc_helpers.pyhttps://github.com/googleapis/python-api-core/pull/30/files#diff-a2ab7509503191e922431f02fd347dd02debe706b046872c0ee6f41785fd0acb
View file https://github.com/plamut/python-api-core/blob/b06c03c97eaede01b8f42eea185336b7e4ac9cdf/tests/unit/test_grpc_helpers.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/googleapis/python-api-core/pull/30/{{ revealButtonHref }}
https://github.com/googleapis/python-api-core/pull/30/files#diff-a2ab7509503191e922431f02fd347dd02debe706b046872c0ee6f41785fd0acb
https://github.com/googleapis/python-api-core/pull/30/files#diff-a2ab7509503191e922431f02fd347dd02debe706b046872c0ee6f41785fd0acb
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.