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 — pubsub: streaming pull needs keepalive · Issue #4083 · googleapis/google-cloud-python

pubsub: streaming pull needs keepalive #4083

New issue
Copy link
New issue
Copy link
Closed
Closed
pubsub: streaming pull needs keepalive#4083
Copy link
Assignees
lukesneeringer
Labels
api: pubsubIssues related to the Pub/Sub API.type: questionRequest for information or clarification. Not an issue.

Description

@pongad
pongad
opened on Sep 29, 2017
Issue body actions

With default configuration, streaming pull will hang if the stream is idle for a few minutes. This usually happens when the subscription has no more messages. In Go, we set gRPC keepalive to 5 minutes (CL). A similar option should be available in Python, though I'm not sure what the code to pass in the option looks like.

Reacted by Auke Bakker, Simon Morley, Max Rusak, Anatoly Stansler and Janto Dreijer

Activity

  1. pongad
    added
    api: pubsubIssues related to the Pub/Sub API.
    on Sep 29, 2017
  2. lukesneeringer commented on Oct 12, 2017

    @lukesneeringer
    lukesneeringer
    on Oct 12, 2017
    Contributor
    More actions

    Does the stream hang or drop? If the stream drops, we do not care.

  3. lukesneeringer
    added
    type: questionRequest for information or clarification. Not an issue.
    on Oct 12, 2017
  4. pongad commented on Oct 13, 2017

    @pongad
    pongad
    on Oct 13, 2017
    ContributorAuthor
    More actions

    I'm not certain what the differences between "hang" and "drop" are, but I'll describe the symptoms in more detail.

    In both Java and Go (and probably others) without keepalive, the stream just never give us new message or notify us of any errors.
    In Java, where we give gRPC callbacks (onNext, onError, and onCompleted) to handle events, none of the callbacks are ever called.
    In Go, where we call msg, err = stream.Recv() the method never returns, giving us neither messages nor errors.

    With keepalive configured, we'll eventually get an error (from experience, either UNAVAILABLE or INTERNAL) and then we can re-create the stream.

  5. makrusak commented on Oct 19, 2017

    @makrusak
    makrusak
    on Oct 19, 2017
    More actions

    @lukesneeringer: I have the same problem with the latest python pub/sub library.
    If there are no new messages on the topic during 2-3 minutes, all will hang and the callback will not be triggered anymore.
    I'm searching for solution.

    In debug logs I see such lines have been repeating every 0-10 seconds.
    After 2-3 minutes without new messages there are no more any "debug" logs and no reaction on new events:

    2017-10-19 18:26:51,169 == DEBUG == Snoozing lease management for 4.454791 seconds.
    2017-10-19 18:26:55,628 == DEBUG == The current p99 value is 10 seconds.
    2017-10-19 18:26:55,629 == DEBUG == Renewing lease for 0 ack IDs.
    2017-10-19 18:26:55,629 == DEBUG == Snoozing lease management for 5.356016 seconds.
    

    My code is exactly like here:
    Subscriber samples

    Reacted by Max Rusak and Anatoly Stansler
  6. lukesneeringer
    closed this as completedin #4269on Oct 30, 2017
  7. makrusak commented on Nov 1, 2017

    @makrusak
    makrusak
    on Nov 1, 2017
    More actions

    @lukesneeringer Still have problem with a hanging connection with latest 0.29.0 pub/sub package. Few minutes after starting the subscriber it stops producing any "debug" logs (in case of absence of messages).
    You can view all debug logs here:
    https://pastebin.com/wCCCh5Fy

  8. JustinBeckwith
    assigned
    lukesneeringer
    on Feb 1, 2021
  9. parthea
    added a commit that references this issue on Jul 6, 2023

    Update dependency google-auth to v1.17.2 [(#4083)](GoogleCloudPlatfor…

    5a32833
  10. parthea
    added a commit that references this issue on Sep 22, 2023

    chore: move samples from python-docs-sample (#66)

    d3dcbbc
  11. parthea
    added a commit that references this issue on Oct 21, 2023

    move monitoring samples from python-docs-samples (#51)

    d95f563
  12. parthea
    added a commit that references this issue on Aug 21, 2025

    Update dependency google-auth to v1.17.2 [(#4083)](GoogleCloudPlatfor…

    68bb78a
  13. parthea
    added a commit that references this issue on Sep 16, 2025

    Update dependency google-auth to v1.17.2 [(#4083)](GoogleCloudPlatfor…

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

Metadata

Metadata

Assignees

  • @lukesneeringer
    lukesneeringer

Labels

api: pubsubIssues related to the Pub/Sub API.type: questionRequest for information or clarification. Not an issue.

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.