Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1e7d469

Browse files
authored
fix: Remove bidi modacks on StreamingPull initial request (#738)
1 parent dc264e9 commit 1e7d469

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -927,20 +927,11 @@ def _get_initial_request(
927927
A request suitable for being the first request on the stream (and not
928928
suitable for any other purpose).
929929
"""
930-
# Any ack IDs that are under lease management need to have their
931-
# deadline extended immediately.
932-
if self._leaser is not None:
933-
# Explicitly copy the list, as it could be modified by another
934-
# thread.
935-
lease_ids = list(self._leaser.ack_ids)
936-
else:
937-
lease_ids = []
938-
939930
# Put the request together.
940931
request = gapic_types.StreamingPullRequest(
941-
modify_deadline_ack_ids=list(lease_ids),
942-
modify_deadline_seconds=[self.ack_deadline] * len(lease_ids),
943932
stream_ack_deadline_seconds=stream_ack_deadline_seconds,
933+
modify_deadline_ack_ids=[],
934+
modify_deadline_seconds=[],
944935
subscription=self._subscription,
945936
client_id=self._client_id,
946937
max_outstanding_messages=(

tests/unit/pubsub_v1/subscriber/test_streaming_pull_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,8 +1318,8 @@ def test__get_initial_request():
13181318
assert isinstance(initial_request, gapic_types.StreamingPullRequest)
13191319
assert initial_request.subscription == "subscription-name"
13201320
assert initial_request.stream_ack_deadline_seconds == 123
1321-
assert initial_request.modify_deadline_ack_ids == ["1", "2"]
1322-
assert initial_request.modify_deadline_seconds == [10, 10]
1321+
assert initial_request.modify_deadline_ack_ids == []
1322+
assert initial_request.modify_deadline_seconds == []
13231323

13241324

13251325
def test__get_initial_request_wo_leaser():

0 commit comments

Comments
 (0)