Title: PubSub Publisher 504 Deadline Exceeded when sending bulk messages · Issue #72 · googleapis/python-pubsub · GitHub
Open Graph Title: PubSub Publisher 504 Deadline Exceeded when sending bulk messages · Issue #72 · googleapis/python-pubsub
X Title: PubSub Publisher 504 Deadline Exceeded when sending bulk messages · Issue #72 · googleapis/python-pubsub
Description: Environment details OS type and version: PRETTY_NAME="Debian GNU/Linux 10 (buster)" Python version: python --version python3.7 pip version: pip --version 20.0.2 google-cloud-pubsub version: pip show google-cloud-pubsub 1.4.2 Steps to rep...
Open Graph Description: Environment details OS type and version: PRETTY_NAME="Debian GNU/Linux 10 (buster)" Python version: python --version python3.7 pip version: pip --version 20.0.2 google-cloud-pubsub version: pip sho...
X Description: Environment details OS type and version: PRETTY_NAME="Debian GNU/Linux 10 (buster)" Python version: python --version python3.7 pip version: pip --version 20.0.2 google-cloud-pubsub versio...
Opengraph URL: https://github.com/googleapis/python-pubsub/issues/72
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PubSub Publisher 504 Deadline Exceeded when sending bulk messages","articleBody":"#### Environment details\r\n\r\n - OS type and version: `PRETTY_NAME=\"Debian GNU/Linux 10 (buster)\"`\r\n - Python version: `python --version` python3.7\r\n - pip version: `pip --version` 20.0.2\r\n - `google-cloud-pubsub` version: `pip show google-cloud-pubsub` 1.4.2\r\n\r\n#### Steps to reproduce\r\n\r\n 1. Send large number of messages to a PubSub Topic fails when I try to send 5000 without pausing and waiting, for example.\r\n 2. Check logs\r\n\r\n#### Code example\r\n\r\n```python\r\n# I have also tried this using the callback and hit the same error. This is what I'm doing now though.\r\niter_size = 5000\r\niter_count = 0\r\nfutures = []\r\nfor row in rows:\r\n data = json.dumps(row, default=lambda x: str(x)).encode('utf-8')\r\n future = publish_client.publish(topic, data, origin='xxx')\r\n futures.append(future)\r\n published_count += 1\r\n iter_count += 1\r\n if iter_count \u003e= iter_size:\r\n [f.result() for f in futures]\r\n futures = []\r\n iter_count = 0\r\n count += 1\r\n [f.result() for f in futures]\r\n```\r\n\r\n#### Stack trace\r\n```\r\n[2020-04-14 14:19:23,788] {{thread.py:264}} ERROR - Failed to publish 141 messages.\r\nTraceback (most recent call last):\r\nFile \"/usr/local/lib/python3.7/site-packages/google/api_core/grpc_helpers.py\", line 57, in error_remapped_callable\r\n return callable_(*args, **kwargs)\r\n File \"/usr/local/lib/python3.7/site-packages/grpc/_channel.py\", line 826, in __call__\r\n return _end_unary_response_blocking(state, call, False, None)\r\n File \"/usr/local/lib/python3.7/site-packages/grpc/_channel.py\", line 729, in _end_unary_response_blocking\r\n raise _InactiveRpcError(state)\r\n grpc._channel._InactiveRpcError: \u003c_InactiveRpcError of RPC that terminated with:\r\n \tstatus = StatusCode.DEADLINE_EXCEEDED\r\n \tdetails = \"Deadline Exceeded\"\r\n \tdebug_error_string = \"{\"created\":\"@1586873963.056617563\",\"description\":\"Error received from peer ipv4:108.177.122.95:443\",\"file\":\"src/core/lib/surface/call.cc\",\"file_line\":1056,\"grpc_message\":\"Deadline Exceeded\",\"grpc_status\":4}\"\r\n \u003e\r\n```\r\n\r\nOther Details:\r\n\r\nI've found a similar issue here \r\nhttps://github.com/googleapis/google-cloud-java/issues/3867\r\n\r\nWhich references to this issue\r\nhttps://github.com/googleapis/google-cloud-java/issues/3003\r\n\r\nThen\r\nhttps://github.com/googleapis/java-pubsub/issues/31\r\n\r\nThis will normally be running on GKE, so I understand me running it locally may have some variation of behavior due to network speed. However, we would prefer to avoid having this issue either way.\r\n\r\nIs this something that is planned/intended to be supported or should I implement auto-throttling?","author":{"url":"https://github.com/dillonjohnson","@type":"Person","name":"dillonjohnson"},"datePublished":"2020-04-14T14:37:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/72/python-pubsub/issues/72"}
| 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:f837453d-af39-655a-fa0e-0ace15dec403 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB58:7F1A9:840CA8:B2B934:6A4D3C7C |
| html-safe-nonce | 1246466a2c66ab619ef00dea91afb6ff512ec2eb2a308e9f7d2eb9fc3791e2b3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjU4OjdGMUE5Ojg0MENBODpCMkI5MzQ6NkE0RDNDN0MiLCJ2aXNpdG9yX2lkIjoiMTA5MTU5NjY2MTk2MjkxNDk0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6be797a676b8768f0bec56e2ee60be6337e269b7786308826ceaa316baa819dd |
| hovercard-subject-tag | issue:599622953 |
| 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/72/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a7ff04becfab6e530f6d321a14df69b3e4c5a1d323022bae07449d60f6fc38e2/googleapis/python-pubsub/issues/72 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a7ff04becfab6e530f6d321a14df69b3e4c5a1d323022bae07449d60f6fc38e2/googleapis/python-pubsub/issues/72 |
| og:image:alt | Environment details OS type and version: PRETTY_NAME="Debian GNU/Linux 10 (buster)" Python version: python --version python3.7 pip version: pip --version 20.0.2 google-cloud-pubsub version: pip sho... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dillonjohnson |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| 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 | 56fc8347865a14e2ec811533d68f929cf4e0ec19 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width