Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit4361e67

Browse files
beltranacocuzzogcf-owl-bot[bot]
authored
fix: batch at most 1,000 ack ids per request (#802)
Co-authored-by: Anna Cocuzzo <63511057+acocuzzo@users.noreply.github.com>Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parentfa23503 commit4361e67

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

‎google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,8 @@
5959
"""The maximum amount of time in seconds to wait for additional request items
6060
before processing the next batch of requests."""
6161

62-
_ACK_IDS_BATCH_SIZE=2500
62+
_ACK_IDS_BATCH_SIZE=1000
6363
"""The maximum number of ACK IDs to send in a single StreamingPullRequest.
64-
65-
The backend imposes a maximum request size limit of 524288 bytes (512 KiB) per
66-
acknowledge / modifyAckDeadline request. ACK IDs have a maximum size of 164
67-
bytes, thus we cannot send more than o 524288/176 ~= 2979 ACK IDs in a single
68-
StreamingPullRequest message.
69-
70-
Accounting for some overhead, we should thus only send a maximum of 2500 ACK
71-
IDs at a time.
7264
"""
7365

7466
_MIN_EXACTLY_ONCE_DELIVERY_ACK_MODACK_RETRY_DURATION_SECS=1

‎tests/unit/pubsub_v1/subscriber/test_dispatcher.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def test_ack_splitting_large_payload():
437437
dispatcher_.ack(items)
438438

439439
calls=manager.send_unary_ack.call_args_list
440-
assertlen(calls)==3
440+
assertlen(calls)==6
441441

442442
all_ack_ids= {item.ack_idforiteminitems}
443443
sent_ack_ids=collections.Counter()
@@ -689,7 +689,7 @@ def test_modify_ack_deadline_splitting_large_payload():
689689
dispatcher_.modify_ack_deadline(items)
690690

691691
calls=manager.send_unary_modack.call_args_list
692-
assertlen(calls)==3
692+
assertlen(calls)==6
693693

694694
all_ack_ids= {item.ack_idforiteminitems}
695695
sent_ack_ids=collections.Counter()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp