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: When returnImmediatly is set to false in a PullRequest it sometimes ignores messages · Issue #3168 · googleapis/google-cloud-java

Pub/Sub: When returnImmediatly is set to false in a PullRequest it sometimes ignores messages #3168

New issue
Copy link
New issue
Copy link
Closed
Closed
Pub/Sub: When returnImmediatly is set to false in a PullRequest it sometimes ignores messages#3168
Copy link
Assignees
idoshamun

Description

@idoshamun
idoshamun
opened on Apr 18, 2018
Issue body actions

I use this snippet for implementing sync pulling:
https://cloud.google.com/pubsub/docs/pull#synchronous-pull

Sometimes when there is a few minutes gap between messages, this snippet doesn't return PullResponse and hangs on the request call.

I ended up doing something like this in the meantime which works perfectly but I don't like the implementation (scala):

Future {
        val pullRequest = PullRequest.newBuilder().setMaxMessages(1).setReturnImmediately(true)
          .setSubscription(subscription.toString).build()
        val pullResponse = subscriber.pullCallable().call(pullRequest)
        pullResponse.getReceivedMessagesList.asScala
      }.flatMap { list =>
        if (list.isEmpty) {
          Thread.sleep(10)
          pull()
        } else {
          Future.successful(list.foreach(callback.invoke))
        }
      }
``

Activity

  1. pongad commented on May 2, 2018

    @pongad
    pongad
    on May 2, 2018
    Contributor
    More actions

    @mdietz94 I think this might be a server issue?

  2. mdietz94 commented on May 2, 2018

    @mdietz94
    mdietz94
    on May 2, 2018
    More actions

    It's WAI. When return immediately is false we may hang up until the max rpc deadline so that we get as many messages as possible. Lowering max messages or reducing the RPC deadline will change the behavior.

  3. idoshamun commented on May 2, 2018

    @idoshamun
    idoshamun
    on May 2, 2018
    Author
    More actions

    I see, thanks. I thought it should not hang up until messages arive

  4. idoshamun
    closed this as completedon May 2, 2018
  5. JustinBeckwith
    assigned
    idoshamun
    on Feb 1, 2021
  6. chingor13
    added a commit that references this issue on Feb 20, 2026

    chore: Add surefire-junit-platform dep to run JUnit5 ITs (#3168)

    9765940
  7. lqiu96
    added a commit that references this issue on Mar 20, 2026

    chore: Add surefire-junit-platform dep to run JUnit5 ITs (#3168)

    ed30715
  8. chingor13
    added 4 commits that reference this issue on Mar 24, 2026

    deps: update google auth library dependencies to v1.25.0 (#3168)

    f48afb7

    chore(main): release 2.45.0 (#3139)

    fbf904c

    chore: add connection property for API tracing (#3168)

    909b835

    test(deps): update dependency io.github.classgraph:classgraph to v4.8…

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

Metadata

Metadata

Assignees

  • @idoshamun
    idoshamun

Labels

No labels
No labels

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.