René's URL Explorer Experiment


Title: Pubsub: Unbounded retry forced when publishing with message ordering enabled · Issue #1702 · googleapis/java-pubsub · GitHub

Open Graph Title: Pubsub: Unbounded retry forced when publishing with message ordering enabled · Issue #1702 · googleapis/java-pubsub

X Title: Pubsub: Unbounded retry forced when publishing with message ordering enabled · Issue #1702 · googleapis/java-pubsub

Description: Summary When publishing to pubsub with message ordering enabled, the library overrides the gRPC retry settings and forces unbounded retry. The application using this library is then unable to detect failures. The workaround is to add tim...

Open Graph Description: Summary When publishing to pubsub with message ordering enabled, the library overrides the gRPC retry settings and forces unbounded retry. The application using this library is then unable to detec...

X Description: Summary When publishing to pubsub with message ordering enabled, the library overrides the gRPC retry settings and forces unbounded retry. The application using this library is then unable to detec...

Opengraph URL: https://github.com/googleapis/java-pubsub/issues/1702

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Pubsub: Unbounded retry forced when publishing with message ordering enabled","articleBody":"#### Summary\r\n\r\nWhen publishing to pubsub with message ordering enabled, the library overrides the gRPC retry settings and forces unbounded retry. The application using this library is then unable to detect failures. The workaround is to add timeout when waiting for the returned future, but this makes the retry/timeout policy scattered and surprising to configure.\r\n\r\nThis is the code that enforces infinite retry.\r\nhttps://github.com/googleapis/java-pubsub/blob/main/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java#L168 line 174 to line 180\r\n\r\nThe exact reason why the infinite retry does not eventually become successful is unclear. We have multiple random occurrences where applications running in a GKE cluster would stop publishing. In some instances, we had even waited for the application to retry for up to a week without success. Unfortunately we do not have a reliable way to trigger this type of failure and we do not have the low level gRPC logs when the failure happened.\r\n\r\nMy suggestion is to allow the library user to set a sane upper bound for retry, and let failures be propagated through the `onFailure` callback.\r\n\r\n#### Environment details\r\n\r\n1. API: Pubsub\r\n2. OS type and version: Ubuntu 22.04\r\n3. Java version: temurin-17.0.8\r\n4.  version(s): google-cloud-pubsub-1.123.12\r\n\r\n#### Steps to reproduce\r\n\r\n  1. Enable message ordering in publisher\r\n  2. Publish messages\r\n  3. Simulate failure, such as network disconnect\r\n\r\n#### Code example\r\n\r\nBased on sample publish code in documentation.\r\n\r\n```java\r\n    Publisher publisher =\r\n        Publisher.newBuilder(topicName)\r\n            // Sending messages to the same region ensures they are received in order\r\n            // even when multiple publishers are used.\r\n            .setEndpoint(\"us-east1-pubsub.googleapis.com:443\")\r\n            .setEnableMessageOrdering(true)\r\n            .build();\r\n\r\n    try {\r\n      Map\u003cString, String\u003e messages = new LinkedHashMap\u003cString, String\u003e();\r\n      messages.put(\"message1\", \"key1\");\r\n      // auto-generate many more messages here ...\r\n\r\n      for (Map.Entry\u003cString, String\u003e entry : messages.entrySet()) {\r\n        ByteString data = ByteString.copyFromUtf8(entry.getKey());\r\n        PubsubMessage pubsubMessage =\r\n            PubsubMessage.newBuilder().setData(data).setOrderingKey(entry.getValue()).build();\r\n        ApiFuture\u003cString\u003e future = publisher.publish(pubsubMessage);\r\n\r\n        // Add an asynchronous callback to handle publish success / failure.\r\n        ApiFutures.addCallback(\r\n            future,\r\n            new ApiFutureCallback\u003cString\u003e() {\r\n\r\n              // onFailure is never called, because the publisher will retry indefinitely\r\n\r\n              @Override\r\n              public void onFailure(Throwable throwable) {\r\n                if (throwable instanceof ApiException) {\r\n                  ApiException apiException = ((ApiException) throwable);\r\n                  // Details on the API exception.\r\n                  System.out.println(apiException.getStatusCode().getCode());\r\n                  System.out.println(apiException.isRetryable());\r\n                }\r\n                System.out.println(\"Error publishing message : \" + pubsubMessage.getData());\r\n              }\r\n\r\n              @Override\r\n              public void onSuccess(String messageId) {\r\n                // Once published, returns server-assigned message ids (unique within the topic).\r\n                System.out.println(pubsubMessage.getData() + \" : \" + messageId);\r\n              }\r\n            },\r\n            MoreExecutors.directExecutor());\r\n      }\r\n    } finally {\r\n      // When finished with the publisher, shutdown to free up resources.\r\n      publisher.shutdown();\r\n      publisher.awaitTermination(1, TimeUnit.MINUTES);\r\n    }\r\n```\r\n\r\n#### Stack trace\r\n```\r\nNo stack trace because of infinite retry\r\n```\r\n\r\n#### External references such as API reference guides\r\n\r\n- https://cloud.google.com/pubsub/docs/publisher\r\n\r\n#### Any additional information below\r\n\r\n","author":{"url":"https://github.com/poernahi","@type":"Person","name":"poernahi"},"datePublished":"2023-08-17T17:09:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/1702/java-pubsub/issues/1702"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:289936ac-478e-50c1-f2e5-8ed420240057
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9F62:1F3B04:6B3E9B:87EDE3:6991353A
html-safe-nonce3d448057f2b69eeec56ce58b630f35885a24555b0ea435f10c4ecf3584bebda1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjYyOjFGM0IwNDo2QjNFOUI6ODdFREUzOjY5OTEzNTNBIiwidmlzaXRvcl9pZCI6IjI1MzkyOTQ5Nzc4NjY2MDE1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf518043b2f8d099d53f922719af128fbf4ed7413a31e7f163deb05214ead4dbb
hovercard-subject-tagissue:1855387230
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/java-pubsub/1702/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ed59511fbce4ed878cbc14ec314768571792b9d1cb5dfcc82956315d611a7b4f/googleapis/java-pubsub/issues/1702
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ed59511fbce4ed878cbc14ec314768571792b9d1cb5dfcc82956315d611a7b4f/googleapis/java-pubsub/issues/1702
og:image:altSummary When publishing to pubsub with message ordering enabled, the library overrides the gRPC retry settings and forces unbounded retry. The application using this library is then unable to detec...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepoernahi
hostnamegithub.com
expected-hostnamegithub.com
None42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b
turbo-cache-controlno-preview
go-importgithub.com/googleapis/java-pubsub git https://github.com/googleapis/java-pubsub.git
octolytics-dimension-user_id16785467
octolytics-dimension-user_logingoogleapis
octolytics-dimension-repository_id203461480
octolytics-dimension-repository_nwogoogleapis/java-pubsub
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id203461480
octolytics-dimension-repository_network_root_nwogoogleapis/java-pubsub
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
release848bc6032dcc93a9a7301dcc3f379a72ba13b96e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/googleapis/java-pubsub/issues/1702#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fjava-pubsub%2Fissues%2F1702
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
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
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
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://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fjava-pubsub%2Fissues%2F1702
Sign up https://patch-diff.githubusercontent.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%2Fjava-pubsub
Reloadhttps://patch-diff.githubusercontent.com/googleapis/java-pubsub/issues/1702
Reloadhttps://patch-diff.githubusercontent.com/googleapis/java-pubsub/issues/1702
Reloadhttps://patch-diff.githubusercontent.com/googleapis/java-pubsub/issues/1702
googleapis https://patch-diff.githubusercontent.com/googleapis
java-pubsubhttps://patch-diff.githubusercontent.com/googleapis/java-pubsub
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fgoogleapis%2Fjava-pubsub
Fork 101 https://patch-diff.githubusercontent.com/login?return_to=%2Fgoogleapis%2Fjava-pubsub
Star 147 https://patch-diff.githubusercontent.com/login?return_to=%2Fgoogleapis%2Fjava-pubsub
Code https://patch-diff.githubusercontent.com/googleapis/java-pubsub
Issues 16 https://patch-diff.githubusercontent.com/googleapis/java-pubsub/issues
Pull requests 26 https://patch-diff.githubusercontent.com/googleapis/java-pubsub/pulls
Actions https://patch-diff.githubusercontent.com/googleapis/java-pubsub/actions
Security 0 https://patch-diff.githubusercontent.com/googleapis/java-pubsub/security
Insights https://patch-diff.githubusercontent.com/googleapis/java-pubsub/pulse
Code https://patch-diff.githubusercontent.com/googleapis/java-pubsub
Issues https://patch-diff.githubusercontent.com/googleapis/java-pubsub/issues
Pull requests https://patch-diff.githubusercontent.com/googleapis/java-pubsub/pulls
Actions https://patch-diff.githubusercontent.com/googleapis/java-pubsub/actions
Security https://patch-diff.githubusercontent.com/googleapis/java-pubsub/security
Insights https://patch-diff.githubusercontent.com/googleapis/java-pubsub/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/googleapis/java-pubsub/issues/1702
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/googleapis/java-pubsub/issues/1702
Pubsub: Unbounded retry forced when publishing with message ordering enabledhttps://patch-diff.githubusercontent.com/googleapis/java-pubsub/issues/1702#top
https://patch-diff.githubusercontent.com/michaelpri10
api: pubsubIssues related to the googleapis/java-pubsub API.https://github.com/googleapis/java-pubsub/issues?q=state%3Aopen%20label%3A%22api%3A%20pubsub%22
priority: p2Moderately-important priority. Fix may not be included in next release.https://github.com/googleapis/java-pubsub/issues?q=state%3Aopen%20label%3A%22priority%3A%20p2%22
type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.https://github.com/googleapis/java-pubsub/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%20request%22
https://github.com/poernahi
https://github.com/poernahi
poernahihttps://github.com/poernahi
on Aug 17, 2023https://github.com/googleapis/java-pubsub/issues/1702#issue-1855387230
https://github.com/googleapis/java-pubsub/blob/main/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java#L168https://github.com/googleapis/java-pubsub/blob/main/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java#L168
https://cloud.google.com/pubsub/docs/publisherhttps://cloud.google.com/pubsub/docs/publisher
michaelpri10https://patch-diff.githubusercontent.com/michaelpri10
api: pubsubIssues related to the googleapis/java-pubsub API.https://github.com/googleapis/java-pubsub/issues?q=state%3Aopen%20label%3A%22api%3A%20pubsub%22
priority: p2Moderately-important priority. Fix may not be included in next release.https://github.com/googleapis/java-pubsub/issues?q=state%3Aopen%20label%3A%22priority%3A%20p2%22
type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.https://github.com/googleapis/java-pubsub/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%20request%22
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.