GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Pub/Sub publisher retrySettings: runtime errors that should be compile time · Issue #2721 · googleapis/google-cloud-java

Pub/Sub publisher retrySettings: runtime errors that should be compile time #2721

New issue
Copy link
New issue
Copy link
Closed
Closed
Pub/Sub publisher retrySettings: runtime errors that should be compile time#2721
Copy link
Assignees
pongad
Labels
api: pubsubIssues related to the Pub/Sub API.triaged for GAtype: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Description

@kir-titievsky
kir-titievsky
opened on Dec 18, 2017
Issue body actions

Publisher built with these retry settings fails at runtime, with generic "illegal argument exception."
The error does point to specific failed pre-conditions, which have to do with minTotalTimeout -- which I had not set here.

        RetrySettings retrySetting = RetrySettings.newBuilder()
                .setInitialRpcTimeout(Duration.ofMillis(500))
                .setMaxAttempts(10)
                .setJittered(Boolean.TRUE)
                .setMaxRpcTimeout(Duration.ofMillis(500))
                .build();

Activity

  1. garrettjonesgoogle
    assigned
    pongad
    on Dec 20, 2017
  2. garrettjonesgoogle
    added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    api: pubsubIssues related to the Pub/Sub API.
    on Dec 20, 2017
  3. pongad commented on Jan 5, 2018

    @pongad
    pongad
    on Jan 5, 2018
    Contributor
    More actions

    I don't think it's possible to turn this into compile time error, but the linked PR should help.

  4. kir-titievsky commented on Jan 5, 2018

    @kir-titievsky
    kir-titievsky
    on Jan 5, 2018
    Author
    More actions

    Compile time errors was indeed a silly request, but I think we could do much better by changing the set of parameters users actually set like so:

    Given this clause:

    Preconditions.checkArgument( his.retrySettings.getTotalTimeout().compareTo(MIN_TOTAL_TIMEOUT) >= 0);

    I propose we deprecate setTotalTimeout and replace it with setTotalTimeoutPadding which sets the private total timeout to MIN_TOTAL_TIMEOUT + PAD.

    Similarly, given

     +        this.retrySettings.getInitialRpcTimeout().compareTo(MIN_RPC_TIMEOUT) >= 0);
    

    we replace setInitialRpcTimeout with setInitialRpcTimeoutPad.

    I think we should do the same for all settings objects with preconditions: batch settings, for example.

    What do you think?

  5. pongad commented on Jan 5, 2018

    @pongad
    pongad
    on Jan 5, 2018
    Contributor
    More actions

    @kir-titievsky I think the problem is that RetrySettings isn't specific to pubsub, it is shared with many other clients where the pad might not make sense. So while I think your proposal make things less error prone, the API might not work.

    It also doesn't help with the case where you forget to set a value. In the linked PR, a new method makes it so you can't forget.

  6. danoscarmike
    added
    triaged for GA
    on Jan 11, 2018
  7. pongad commented on Feb 1, 2018

    @pongad
    pongad
    on Feb 1, 2018
    Contributor
    More actions

    Moved to feature wiki.

  8. pongad
    closed this as completedon Feb 1, 2018
  9. theacodes
    unassigned
    pongad
    on Sep 28, 2018
  10. JustinBeckwith
    assigned
    pongad
    on Feb 1, 2021
  11. chingor13
    added a commit that references this issue on Feb 20, 2026

    deps: update dependency org.junit.vintage:junit-vintage-engine to v5.…

    0bc725c
  12. chingor13
    added 2 commits that reference this issue on Mar 24, 2026

    chore: follow up fix to verify_library_generation (#2721)

    2479348

    deps: update dependency com.google.cloud:sdk-platform-java-config to …

    71a5e3a
  13. rahul2393
    added a commit that references this issue on May 21, 2026

    test: Add missing test table cleanup for MaterializedViewIT (googleap…

    ba25691
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @pongad
    pongad

Labels

api: pubsubIssues related to the Pub/Sub API.triaged for GAtype: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.