Title: PubSub: Subscriber keeps failing with 503 · Issue #75 · googleapis/python-pubsub · GitHub
Open Graph Title: PubSub: Subscriber keeps failing with 503 · Issue #75 · googleapis/python-pubsub
X Title: PubSub: Subscriber keeps failing with 503 · Issue #75 · googleapis/python-pubsub
Description: Hey guys, I am seeing the pubsub client receive a 503 unavailable and instead of retrying it just exits. And it can't receive any more messages. The subscriber starts and works for a few minutes before throwing the error. I can reproduce...
Open Graph Description: Hey guys, I am seeing the pubsub client receive a 503 unavailable and instead of retrying it just exits. And it can't receive any more messages. The subscriber starts and works for a few minutes be...
X Description: Hey guys, I am seeing the pubsub client receive a 503 unavailable and instead of retrying it just exits. And it can't receive any more messages. The subscriber starts and works for a few minute...
Opengraph URL: https://github.com/googleapis/python-pubsub/issues/75
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PubSub: Subscriber keeps failing with 503","articleBody":"Hey guys, \r\n\r\nI am seeing the pubsub client receive a 503 unavailable and instead of retrying it just exits. And it can't receive any more messages. The subscriber starts and works for a few minutes before throwing the error. I can reproduce it consistently with multiple different pubsub subscriptions. \r\n\r\n**Package**: google-cloud-pubsub==1.4.2\r\n**OS**: Mac Catalina, also tried on an Ubuntu VM. \r\n**Python**: Python 3.7.3\r\n\r\n\r\nHere is an example test case where I see the issue followed by a stack trace: \r\n\r\n```\r\nimport os\r\nimport json\r\nfrom time import sleep\r\nfrom datetime import datetime\r\nimport logging\r\nfrom google.cloud import pubsub_v1\r\nfrom config import Config\r\n\r\nlogging.basicConfig()\r\nlogging.getLogger().setLevel(logging.DEBUG)\r\n\r\ndef _callback(message):\r\n try:\r\n print('message', message)\r\n except Exception:\r\n print('exception')\r\n\r\nif __name__ == '__main__':\r\n\r\n subscription = pubsub_v1.SubscriberClient()\r\n subscription_path = subscription.subscription_path(\r\n Config.PROJECT_ID,\r\n Config.PUBSUB_SUB_NAME)\r\n\r\n\r\n future = subscription.subscribe(\r\n subscription_path,\r\n _callback,\r\n pubsub_v1.types.FlowControl(max_messages=Config.MAX_MESSAGES))\r\n\r\n try:\r\n future.result()\r\n \r\n except KeyboardInterrupt:\r\n future.cancel()\r\n logging.error(\"Keyboard Interrupt\")\r\n \r\n except Exception:\r\n raise\r\n\r\n```\r\n\r\nAnd stack trace - \r\n\r\n```\r\nDEBUG:google.cloud.pubsub_v1.subscriber._protocol.leaser:Snoozing lease management for 8.538204 seconds.\r\nDEBUG:google.api_core.bidi:Thread-ConsumeBidirectionalStream caught error 503 The service was unable to fulfill your request. Please try again. [code=8a75] and will exit. Generally this is due to the RPC itself being cancelled and the error will be surfaced to the calling code.\r\nTraceback (most recent call last):\r\n File \"/Users/tameem/pubsub-test/env/lib/python3.7/site-packages/google/api_core/grpc_helpers.py\", line 144, in error_remapped_callable\r\n return _StreamingResponseIterator(result)\r\n File \"/Users/tameem/pubsub-test/env/lib/python3.7/site-packages/google/api_core/grpc_helpers.py\", line 72, in __init__\r\n self._stored_first_result = six.next(self._wrapped)\r\n File \"/Users/tameem/pubsub-test/env/lib/python3.7/site-packages/grpc/_channel.py\", line 416, in __next__\r\n return self._next()\r\n File \"/Users/tameem/pubsub-test/env/lib/python3.7/site-packages/grpc/_channel.py\", line 706, in _next\r\n raise self\r\ngrpc._channel._MultiThreadedRendezvous: \u003c_MultiThreadedRendezvous of RPC that terminated with:\r\n\tstatus = StatusCode.UNAVAILABLE\r\n\tdetails = \"The service was unable to fulfill your request. Please try again. [code=8a75]\"\r\n\tdebug_error_string = \"{\"created\":\"@1587006128.267570000\",\"description\":\"Error received from peer ipv6:[]:443\",\"file\":\"src/core/lib/surface/call.cc\",\"file_line\":1056,\"grpc_message\":\"The service was unable to fulfill your request. Please try again. [code=8a75]\",\"grpc_status\":14}\"\r\n\u003e\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n File \"/Users/tameem/pubsub-test/env/lib/python3.7/site-packages/google/api_core/bidi.py\", line 637, in _thread_main\r\n self._bidi_rpc.open()\r\n File \"/Users/tameem/pubsub-test/env/lib/python3.7/site-packages/google/api_core/bidi.py\", line 280, in open\r\n call = self._start_rpc(iter(request_generator), metadata=self._rpc_metadata)\r\n File \"/Users/tameem/pubsub-test/env/lib/python3.7/site-packages/google/cloud/pubsub_v1/gapic/subscriber_client.py\", line 1059, in streaming_pull\r\n requests, retry=retry, timeout=timeout, metadata=metadata\r\n File \"/Users/tameem/pubsub-test/env/lib/python3.7/site-packages/google/api_core/gapic_v1/method.py\", line 143, in __call__\r\n return wrapped_func(*args, **kwargs)\r\n File \"/Users/tameem/pubsub-test/env/lib/python3.7/site-packages/google/api_core/retry.py\", line 286, in retry_wrapped_func\r\n on_error=on_error,\r\n File \"/Users/tameem/pubsub-test/env/lib/python3.7/site-packages/google/api_core/retry.py\", line 184, in retry_target\r\n return target()\r\n File \"/Users/tameem/pubsub-test/env/lib/python3.7/site-packages/google/api_core/timeout.py\", line 214, in func_with_timeout\r\n return func(*args, **kwargs)\r\n File \"/Users/tameem/pubsub-test/env/lib/python3.7/site-packages/google/api_core/grpc_helpers.py\", line 146, in error_remapped_callable\r\n six.raise_from(exceptions.from_grpc_error(exc), exc)\r\n File \"\u003cstring\u003e\", line 3, in raise_from\r\ngoogle.api_core.exceptions.ServiceUnavailable: 503 The service was unable to fulfill your request. Please try again. [code=8a75]\r\nINFO:google.api_core.bidi:Thread-ConsumeBidirectionalStream exiting\r\nINFO:google.cloud.pubsub_v1.subscriber._protocol.leaser:Thread-LeaseMaintainer exiting.\r\nINFO:google.cloud.pubsub_v1.subscriber._protocol.heartbeater:Thread-Heartbeater exiting.\r\n```\r\n","author":{"url":"https://github.com/tameemiftikhar","@type":"Person","name":"tameemiftikhar"},"datePublished":"2020-04-16T03:04:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/75/python-pubsub/issues/75"}
| 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:7df552c9-0158-432f-80dd-7a53865febc8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C40A:512E3:ECEFE:155B89:6A4E641F |
| html-safe-nonce | 7304b4a0daaef62988ece0a406a5c18120d7c6b69bc94e301144e68163e29734 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDBBOjUxMkUzOkVDRUZFOjE1NUI4OTo2QTRFNjQxRiIsInZpc2l0b3JfaWQiOiI1MTM1ODYwODg4NjI0ODQ5OTUxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 538881a6ce2f41a19d37c5ed510bd8130cff5f219fef596d85bf7c168cc081f6 |
| hovercard-subject-tag | issue:600871741 |
| 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/python-pubsub/75/issue_layout |
| twitter:image | https://opengraph.githubassets.com/10b95a4abb19a0c097f0239af56ef5fdde693d51dbab665ff797714e5e32e712/googleapis/python-pubsub/issues/75 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/10b95a4abb19a0c097f0239af56ef5fdde693d51dbab665ff797714e5e32e712/googleapis/python-pubsub/issues/75 |
| og:image:alt | Hey guys, I am seeing the pubsub client receive a 503 unavailable and instead of retrying it just exits. And it can't receive any more messages. The subscriber starts and works for a few minutes be... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tameemiftikhar |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/python-pubsub git https://github.com/googleapis/python-pubsub.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 226992581 |
| octolytics-dimension-repository_nwo | googleapis/python-pubsub |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 226992581 |
| octolytics-dimension-repository_network_root_nwo | googleapis/python-pubsub |
| 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 | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width