Title: Calling `subscription.pull(return_immediately=True)` hangs · Issue #1441 · googleapis/google-cloud-python · GitHub
Open Graph Title: Calling `subscription.pull(return_immediately=True)` hangs · Issue #1441 · googleapis/google-cloud-python
X Title: Calling `subscription.pull(return_immediately=True)` hangs · Issue #1441 · googleapis/google-cloud-python
Description: I've got a fairly simple PubSub setup. The subscriber tries to pull from a topic with return_immediately set to True, and performs some actions based on the data that was returned. If there was no data, the consumer waits up to 5 seconds...
Open Graph Description: I've got a fairly simple PubSub setup. The subscriber tries to pull from a topic with return_immediately set to True, and performs some actions based on the data that was returned. If there was no ...
X Description: I've got a fairly simple PubSub setup. The subscriber tries to pull from a topic with return_immediately set to True, and performs some actions based on the data that was returned. If there was...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/1441
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Calling `subscription.pull(return_immediately=True)` hangs","articleBody":"I've got a fairly simple PubSub setup. The subscriber tries to pull from a topic with `return_immediately` set to `True`, and performs some actions based on the data that was returned. If there was no data, the consumer waits up to 5 seconds and tries again. In pseudocode:\n\n``` python\nclient = pubsub.get_client()\ntopic = client.get_topic()\nsubscription = topic.get_subscription()\nwhile True:\n data = subscription.pull(return_immediately=True)\n if data:\n do_work(data)\n else:\n sleep(5)\n```\n\nI've noticed that after running this for a while, my subscriber just hangs on the `subscription.pull(return_immediately=True)` call. I would expect that, if a network error occurs, the connection would time out and that the function call would result in an exception.\n\nI've tried debugging this by setting the log level of the `oauth2client` and `oauth2client.client` loggers to `logging.DEBUG`, but this didn't help me. I've also looked at the `gcloud.connection` file, but didn't find where the error might occur.\n\nIf I'm doing anything wrong, or can help solve this problem in another way, then don't hesitate to ask!\n","author":{"url":"https://github.com/GilJ","@type":"Person","name":"GilJ"},"datePublished":"2016-02-08T16:36:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/1441/google-cloud-python/issues/1441"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f110a8d3-476a-73cb-d3bc-3ebf2cb81649 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B01C:34CFAA:1195FC:17D026:6A4D2F91 |
| html-safe-nonce | deedf266468e3c6b06ae3de64795103066e73049dc99015d5d1c6d0fd0cb0ad9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDFDOjM0Q0ZBQToxMTk1RkM6MTdEMDI2OjZBNEQyRjkxIiwidmlzaXRvcl9pZCI6IjI4MzE2OTc0MjUyNDMyOTg3MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | deb1d29aea5f2c1ea09557dc25509304dd3171140f972e2ddb4313aba5545cef |
| hovercard-subject-tag | issue:132190388 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-python/1441/issue_layout |
| twitter:image | https://opengraph.githubassets.com/96476d3581490f4457cf10fa9896225e8a8480f4fdb868175acb13ceecd02674/googleapis/google-cloud-python/issues/1441 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/96476d3581490f4457cf10fa9896225e8a8480f4fdb868175acb13ceecd02674/googleapis/google-cloud-python/issues/1441 |
| og:image:alt | I've got a fairly simple PubSub setup. The subscriber tries to pull from a topic with return_immediately set to True, and performs some actions based on the data that was returned. If there was no ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | GilJ |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 16316451 |
| octolytics-dimension-repository_nwo | googleapis/google-cloud-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16316451 |
| octolytics-dimension-repository_network_root_nwo | googleapis/google-cloud-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 93f17a978ee60bc4668e1d7b90e6bd2d622261fd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width