Skip to content

If AutoAck pull returns empty then exception raised on context exit #2878

@quom

Description

@quom

If the subscription pull returns 0 messages in the enter method in the AutoAck class then on exit the acknowledge call raises an exception on the HTTP call: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/pubsub-0.22.0/pubsub/google/cloud/pubsub/subscription.py#L512

Currently the way a deal with this is to wrap the context manager in try/except or override exit to check for an empty list. The former is messy and the latter can just be fixed at source.

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the Pub/Sub API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions