googleapis / googleapis/google-cloud-python

Make initial modack asynchronous

Open
#15,645 1 comment 0 reactions 1 assignee Claimed by @abbrowne126 View on GitHub
api: pubsub type: feature request
Dominant language
Python
Stars
5.4k
Forks
1.8k
Avg merge
3d 4h
Merged PRs (30d)
122

Description

See [this bug in the issue tracker](https://issuetracker.google.com/issues/329314022) for context. The initial modack is [initiated synchronously](https://github.com/googleapis/python-pubsub/blob/main/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py#L1101-L1104) upon receiving a message. In contrast, Java [queues them to happen asynchronously](https://github.com/googleapis/java-pubsub/blob/20099510c647bd8292711976d6eaeceef98bbed8/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/MessageDispatcher.java#L417). This appears to have some performance implications. We should instead queue these up to happen asynchronously, though we need to ensure we execute them relatively soon. Right now, they could happen as late as [90% of the ack deadline](https://github.com/googleapis/python-pubsub/blob/2b35e6557e16885ea8e6d4695b8dd3f3bd960eab/google/cloud/pubsub_v1/subscriber/_protocol/leaser.py#L230-L232).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.