File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
google/cloud/pubsub_v1/subscriber/_protocol
tests/unit/pubsub_v1/subscriber Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 3737"""The maximum amount of time in seconds to wait for additional request items
3838before processing the next batch of requests."""
3939
40- _ACK_IDS_BATCH_SIZE = 3000
40+ _ACK_IDS_BATCH_SIZE = 2500
4141"""The maximum number of ACK IDs to send in a single StreamingPullRequest.
4242
4343The backend imposes a maximum request size limit of 524288 bytes (512 KiB) per
4444acknowledge / modifyAckDeadline request. ACK IDs have a maximum size of 164
45- bytes, thus we cannot send more than o 524288/164 ~= 3197 ACK IDs in a single
45+ bytes, thus we cannot send more than o 524288/176 ~= 2979 ACK IDs in a single
4646StreamingPullRequest message.
4747
48- Accounting for some overhead, we should thus only send a maximum of 3000 ACK
48+ Accounting for some overhead, we should thus only send a maximum of 2500 ACK
4949IDs at a time.
5050"""
5151
Original file line number Diff line number Diff line change @@ -102,9 +102,9 @@ def test_ack_splitting_large_payload():
102102 dispatcher_ = dispatcher .Dispatcher (manager , mock .sentinel .queue )
103103
104104 items = [
105- # use realistic lengths for ACK IDs (max 164 bytes)
106- requests .AckRequest (ack_id = str (i ).zfill (164 ), byte_size = 0 , time_to_ack = 20 )
107- for i in range (6001 )
105+ # use realistic lengths for ACK IDs (max 176 bytes)
106+ requests .AckRequest (ack_id = str (i ).zfill (176 ), byte_size = 0 , time_to_ack = 20 )
107+ for i in range (5001 )
108108 ]
109109 dispatcher_ .ack (items )
110110
@@ -187,9 +187,9 @@ def test_modify_ack_deadline_splitting_large_payload():
187187 dispatcher_ = dispatcher .Dispatcher (manager , mock .sentinel .queue )
188188
189189 items = [
190- # use realistic lengths for ACK IDs (max 164 bytes)
191- requests .ModAckRequest (ack_id = str (i ).zfill (164 ), seconds = 60 )
192- for i in range (6001 )
190+ # use realistic lengths for ACK IDs (max 176 bytes)
191+ requests .ModAckRequest (ack_id = str (i ).zfill (176 ), seconds = 60 )
192+ for i in range (5001 )
193193 ]
194194 dispatcher_ .modify_ack_deadline (items )
195195
You can’t perform that action at this time.
0 commit comments