Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Calling subscription.pull(return_immediately=True) hangs #1441

Copy link
Copy link
@GilJ

Description

@GilJ
Issue body actions

I've got a fairly simple PubSub setup. The subscriber tries to pull from a topic with return_immediately set to True, and performs some actions based on the data that was returned. If there was no data, the consumer waits up to 5 seconds and tries again. In pseudocode:

client = pubsub.get_client()
topic = client.get_topic()
subscription = topic.get_subscription()
while True:
    data = subscription.pull(return_immediately=True)
    if data:
        do_work(data)
    else:
        sleep(5)

I've noticed that after running this for a while, my subscriber just hangs on the subscription.pull(return_immediately=True) call. I would expect that, if a network error occurs, the connection would time out and that the function call would result in an exception.

I've tried debugging this by setting the log level of the oauth2client and oauth2client.client loggers to logging.DEBUG, but this didn't help me. I've also looked at the gcloud.connection file, but didn't find where the error might occur.

If I'm doing anything wrong, or can help solve this problem in another way, then don't hesitate to ask!

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.