fix: market hub WS 1009, user-hub stale reconnect, stats await, Practice live lookup - #132
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v4.1.2 PATCH for live TradingSuite issues #128–#131.
HUB_RECEIVE_MAX_SIZEis pysignalr/websockets incoming frame size in bytes, not a 10,000-message queue. Raise it to the 1 MiB default so MNQ/MES DOM snapshots no longer close-loop with WS 1009.stop()drops the pysignalr client so reconnect cannot raiseCannot connect while not disconnected. Watchdog-initiated reconnect keeps a single loop.StatisticsAggregatorawaits asyncget_stats()/get_statistics()/get_memory_stats()instead of dropping the coroutine on every snapshot. A timeout no longer falls through to the next method.get_instrument(symbol, live=True)retrieslive=Falsewith a warning when Gateway returns a successful empty live/listed search (Practice/sim MNQ/MES).success: falsestill raises.Test plan
tests/realtime/test_async_hub.py— 1 MiB frame cap; stop/start recreates clienttests/realtime/test_health_monitoring.py— user hub silence is not stale; market freeze still reconnects; watchdog self-stop does not spawn a second loop; reconnect waits for hubrun()to finishtests/statistics/test_statistics_module.py— asyncget_stats()is awaited; timeout does not return fallback dicttests/client/test_market_data.py— live=True empty list falls back; live=False still raises; success=false does not fallbackuv run pytest tests/ --ignore=tests/benchmarks/(3175 passed before review follow-ups; targeted suites green after)uv run ruff check src/and.venv/bin/python -m mypy src/Fixes #128
Fixes #129
Fixes #130
Fixes #131