René's URL Explorer Experiment


Title: Regression in v2.13.0: ConsumeBidirectionalStream caught unexpected exception and will exit · Issue #560 · googleapis/python-api-core · GitHub

Open Graph Title: Regression in v2.13.0: ConsumeBidirectionalStream caught unexpected exception and will exit · Issue #560 · googleapis/python-api-core

X Title: Regression in v2.13.0: ConsumeBidirectionalStream caught unexpected exception and will exit · Issue #560 · googleapis/python-api-core

Description: tl;dr: Cause and fix I believe v2.13.0 introduced a regression here: v2.12.0...v2.13.0#diff-769a9f2c04700ff355d77a3292b7ff3cea5ff9bda91d0b31138eeb89fcd4d02dL95-L98 v2.12.0 code: def _is_active(self): # Note: there is a possibility that t...

Open Graph Description: tl;dr: Cause and fix I believe v2.13.0 introduced a regression here: v2.12.0...v2.13.0#diff-769a9f2c04700ff355d77a3292b7ff3cea5ff9bda91d0b31138eeb89fcd4d02dL95-L98 v2.12.0 code: def _is_active(self...

X Description: tl;dr: Cause and fix I believe v2.13.0 introduced a regression here: v2.12.0...v2.13.0#diff-769a9f2c04700ff355d77a3292b7ff3cea5ff9bda91d0b31138eeb89fcd4d02dL95-L98 v2.12.0 code: def _is_active(self...

Opengraph URL: https://github.com/googleapis/python-api-core/issues/560

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Regression in v2.13.0: ConsumeBidirectionalStream caught unexpected exception  and will exit","articleBody":"#### tl;dr: Cause and fix\r\n\r\nI believe v2.13.0 introduced a regression here: https://github.com/googleapis/python-api-core/compare/v2.12.0...v2.13.0#diff-769a9f2c04700ff355d77a3292b7ff3cea5ff9bda91d0b31138eeb89fcd4d02dL95-L98\r\n\r\nv2.12.0 code:\r\n```\r\n    def _is_active(self):\r\n        # Note: there is a possibility that this starts *before* the call\r\n        # property is set. So we have to check if self.call is set before\r\n        # seeing if it's active.\r\n        if self.call is not None and not self.call.is_active():\r\n            return False\r\n        else:\r\n            return True\r\n```\r\n\r\nv2.13.0 code:\r\n\r\n```\r\n    def _is_active(self):\r\n        # Note: there is a possibility that this starts *before* the call\r\n        # property is set. So we have to check if self.call is set before\r\n        # seeing if it's active.\r\n        return self.call is not None and self.call.is_active()\r\n```\r\n\r\nNote that in `v2.12.0` version `_is_active()` will return True when `self.call is None` but in `v2.13.0` this will return False.\r\n\r\nThis seems to very directly violate the behaviour highlighted in the comment:\r\n\r\n```\r\n        # Note: there is a possibility that this starts *before* the call\r\n        # property is set. So we have to check if self.call is set before\r\n        # seeing if it's active.\r\n```\r\n\r\nAs such the fix should be as simple as\r\n\r\n```\r\nreturn self.call is None or self.call.is_active()\r\n```\r\n\r\n#### Environment details\r\n\r\n  - OS type and version: Mac 14.1.1 \r\n  - Python version: `python --version`: 3.9.18\r\n  - pip version: `pip --version`: 22.3\r\n  - `google-api-core` version: `pip show google-api-core`\r\n\r\n```\r\nName: google-api-core\r\nVersion: 2.14.0\r\nSummary: Google API client core library\r\nHome-page: https://github.com/googleapis/python-api-core\r\nAuthor: Google LLC\r\nAuthor-email: googleapis-packages@google.com\r\nLicense: Apache 2.0\r\nLocation: /Users/dhendry/code/perpetua-pybackend-common/.venv/lib/python3.9/site-packages\r\nRequires: google-auth, googleapis-common-protos, protobuf, requests\r\nRequired-by: firebase-admin, google-api-python-client, google-cloud-appengine-logging, google-cloud-bigquery, google-cloud-bigquery-storage, google-cloud-core, google-cloud-firestore, google-cloud-logging, google-cloud-pubsub, google-cloud-secret-manager, google-cloud-storage, google-cloud-tasks\r\n```\r\n\r\nAlso relevant here: \r\n\r\n```\r\nName: google-cloud-bigquery-storage\r\nVersion: 2.22.0\r\nSummary: Google Cloud Bigquery Storage API client library\r\nHome-page: https://github.com/googleapis/python-bigquery-storage\r\nAuthor: Google LLC\r\nAuthor-email: googleapis-packages@google.com\r\nLicense: Apache 2.0\r\nLocation: /Users/dhendry/code/perpetua-pybackend-common/.venv/lib/python3.9/site-packages\r\nRequires: google-api-core, proto-plus, protobuf\r\nRequired-by: perpetua-pybackend-common\r\n```\r\n\r\n#### Steps to reproduce\r\n\r\nAfter upgrading `google-api-core` from `2.12.0` to `2.13.0` we are seeing an `ConsumeBidirectionalStream caught unexpected exception  and will exit.` error when using the `BigQueryWriteClient`. I have narrowed down the issue to this library, NOT the google-cloud-bigquery-storage library\r\n\r\nNote: you many need to be on a slow-ish network connection (\u003c= ~50 MBit/sec) to reproduce reliably.\r\n\r\n  1. Create an `AppendRowsStream`\r\n  2. Call `.send()` with a large `AppendRowsRequest` request (close to the maximum, say 9 MB). Very specifically, it seems that the request must be large enough to take more than 1 second to complete (1 second because that is the default value for `google.api_core.bidi._RequestQueueGenerator._period`)\r\n  3. An exception will be raised\r\n\r\n#### Code example\r\n\r\n```python\r\nfrom google.cloud.bigquery_storage_v1 import BigQueryWriteClient\r\nfrom google.cloud.bigquery_storage_v1.types import ProtoRows, ProtoSchema\r\nfrom google.cloud.bigquery_storage_v1.types.storage import AppendRowsRequest\r\nfrom google.cloud.bigquery_storage_v1.writer import AppendRowsStream\r\n\r\ns = AppendRowsStream(\r\n    BigQueryWriteClient(),\r\n    AppendRowsRequest(\r\n        write_stream=\"STREAM NAME\",\r\n        proto_rows=AppendRowsRequest.ProtoData(\r\n            writer_schema=ProtoSchema(proto_descriptor=\"ADD PROTO DESCRIPTOR\"),\r\n        ),\r\n    ),\r\n)\r\n\r\ns.send(\r\n    AppendRowsRequest(\r\n        proto_rows=AppendRowsRequest.ProtoData(\r\n            rows=ProtoRows(serialized_rows=[SERIALIZED ROWS TOTALLING ~9mb])\r\n        )\r\n    )\r\n)\r\n```\r\n\r\n#### Stack trace\r\n```\r\n2023-11-30 17:33:07,189 [DEBUG] Started helper thread Thread-ConsumeBidirectionalStream\r\n2023-11-30 17:33:14,180 [DEBUG] Empty queue and inactive call, exiting request generator.\r\n2023-11-30 17:33:14,266 [DEBUG] waiting for recv.\r\n2023-11-30 17:33:14,266 [DEBUG] recved response.\r\n2023-11-30 17:33:14,266 [DEBUG] waiting for recv.\r\n2023-11-30 17:33:14,268 [INFO] RPC termination has signaled streaming pull manager shutdown.\r\n2023-11-30 17:33:14,268 [ERROR] Thread-ConsumeBidirectionalStream caught unexpected exception  and will exit.\r\nTraceback (most recent call last):\r\n  File \".venv/lib/python3.9/site-packages/google/api_core/bidi.py\", line 662, in _thread_main\r\n    response = self._bidi_rpc.recv()\r\n  File \".venv/lib/python3.9/site-packages/google/api_core/bidi.py\", line 345, in recv\r\n    return next(self.call)\r\n  File \".venv/lib/python3.9/site-packages/google/api_core/grpc_helpers.py\", line 115, in __next__\r\n    return next(self._wrapped)\r\n  File \".venv/lib/python3.9/site-packages/grpc/_channel.py\", line 541, in __next__\r\n    return self._next()\r\n  File \".venv/lib/python3.9/site-packages/grpc/_channel.py\", line 965, in _next\r\n    raise StopIteration()\r\nStopIteration\r\n2023-11-30 17:33:14,268 [DEBUG] Stopping consumer.\r\n2023-11-30 17:33:14,269 [INFO] Thread-ConsumeBidirectionalStream exiting\r\n```\r\n\r\n\r\n","author":{"url":"https://github.com/dhendry","@type":"Person","name":"dhendry"},"datePublished":"2023-11-30T18:16:13.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/560/python-api-core/issues/560"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:83df241f-7db7-6a7e-6de5-4354c37be8f9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8DAC:1E086E:DD0197:14219D5:6A4E2C69
html-safe-nonce932f68774c348a86931c7048ee2c6830b622965c527f8836ed17a5dda421fe86
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4REFDOjFFMDg2RTpERDAxOTc6MTQyMTlENTo2QTRFMkM2OSIsInZpc2l0b3JfaWQiOiI2MDk4OTU3MjY0MDg4ODY5OTkzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac655693a4835d475c7bc84191407e653263356477b925646d15915d5aeb60f05d
hovercard-subject-tagissue:2019248844
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/python-api-core/560/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d5843f9e1096466ff0d273c09d02802091514d574afdb1bc34027d3896605bc1/googleapis/python-api-core/issues/560
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d5843f9e1096466ff0d273c09d02802091514d574afdb1bc34027d3896605bc1/googleapis/python-api-core/issues/560
og:image:alttl;dr: Cause and fix I believe v2.13.0 introduced a regression here: v2.12.0...v2.13.0#diff-769a9f2c04700ff355d77a3292b7ff3cea5ff9bda91d0b31138eeb89fcd4d02dL95-L98 v2.12.0 code: def _is_active(self...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedhendry
hostnamegithub.com
expected-hostnamegithub.com
None030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released9dd20d38f8ae3c4cb6b597807431db300d0bd2a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/googleapis/python-api-core/issues/560#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fpython-api-core%2Fissues%2F560
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%2Fissues%2F560
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%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=googleapis%2Fpython-api-core
Reloadhttps://github.com/googleapis/python-api-core/issues/560
Reloadhttps://github.com/googleapis/python-api-core/issues/560
Reloadhttps://github.com/googleapis/python-api-core/issues/560
Please reload this pagehttps://github.com/googleapis/python-api-core/issues/560
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
#562https://github.com/googleapis/python-api-core/pull/562
Regression in v2.13.0: ConsumeBidirectionalStream caught unexpected exception and will exithttps://github.com/googleapis/python-api-core/issues/560#top
#562https://github.com/googleapis/python-api-core/pull/562
https://github.com/dhendry
dhendryhttps://github.com/dhendry
on Nov 30, 2023https://github.com/googleapis/python-api-core/issues/560#issue-2019248844
v2.12.0...v2.13.0#diff-769a9f2c04700ff355d77a3292b7ff3cea5ff9bda91d0b31138eeb89fcd4d02dL95-L98https://github.com/googleapis/python-api-core/compare/v2.12.0...v2.13.0#diff-769a9f2c04700ff355d77a3292b7ff3cea5ff9bda91d0b31138eeb89fcd4d02dL95-L98
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.