Skip to content

Commit f6db29b

Browse files
committed
FIX: Live client subscription batch size
1 parent 0bd50d6 commit f6db29b

File tree

3 files changed

+13
-22
lines changed

3 files changed

+13
-22
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 0.24.1 - TBD
4+
5+
#### Bug fixes
6+
- Fixed issue where a large unreadable symbol subscription message could be sent
7+
38
## 0.24.0 - 2023-11-23
49

510
This release adds support for DBN v2 as well as Python v3.12.

databento/live/protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434

3535
RECV_BUFFER_SIZE: Final = 64 * 2**10 # 64kb
36-
SYMBOL_LIST_BATCH_SIZE: Final = 64
36+
SYMBOL_LIST_BATCH_SIZE: Final = 32
3737

3838
logger = logging.getLogger(__name__)
3939

tests/test_live_client.py

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -427,27 +427,13 @@ async def test_live_subscribe_large_symbol_list(
427427
symbols=large_symbol_list,
428428
)
429429

430-
first_message = mock_live_server.get_message_of_type(
431-
gateway.SubscriptionRequest,
432-
timeout=1,
433-
).symbols.split(",")
434-
435-
second_message = mock_live_server.get_message_of_type(
436-
gateway.SubscriptionRequest,
437-
timeout=1,
438-
).symbols.split(",")
439-
440-
third_message = mock_live_server.get_message_of_type(
441-
gateway.SubscriptionRequest,
442-
timeout=1,
443-
).symbols.split(",")
444-
445-
fourth_message = mock_live_server.get_message_of_type(
446-
gateway.SubscriptionRequest,
447-
timeout=1,
448-
).symbols.split(",")
449-
450-
reconstructed = first_message + second_message + third_message + fourth_message
430+
reconstructed: list[str] = []
431+
for _ in range(8):
432+
message = mock_live_server.get_message_of_type(
433+
gateway.SubscriptionRequest,
434+
timeout=1,
435+
).symbols.split(",")
436+
reconstructed.extend(message)
451437

452438
# Assert
453439
assert reconstructed == large_symbol_list

0 commit comments

Comments
 (0)