tastyware / tastytrade

An unofficial Python SDK for Tastytrade!
MIT License
106 stars 38 forks source link

Candle Stream Connection Failure #161

Open Vscheidell opened 1 month ago

Vscheidell commented 1 month ago

Hello all,

I noticed yesterday my script stop receiveing data around 10:13. When I went to the logs, these were the latest entries. Is it safe to assume that my machine simply lost internet connection for a minute which is why the keepalive pings failed and eventually ended the connection?

DEBUG | 2024-08-08 10:13:26,508 | func: subscribe | line: 441 | sending subscription: {'type': 'FEED_SUBSCRIPTION', 'channel': 1, 'add': [{'symbol': 'SPY', 'type': <EventType.CANDLE: 'Candle'>}, {'symbol': 'QQQ', 'type': <EventType.CANDLE: 'Candle'>}, {'symbol': 'IWM', 'type': <EventType.CANDLE: 'Candle'>}, {'symbol': 'AAPL', 'type': <EventType.CANDLE: 'Candle'>}]} | MainThread: 17344 DEBUG | 2024-08-08 10:13:26,508 | func: write_frame_sync | line: 1174 | > TEXT '{"type": "FEED_SUBSCRIPTION", "channel": 1, "ad...I", "type": "Candle"}]}' [201 bytes] | MainThread: 17344 DEBUG | 2024-08-08 10:13:42,324 | func: keepalive_ping | line: 1261 | % sending keepalive ping | MainThread: 17344 DEBUG | 2024-08-08 10:13:42,324 | func: write_frame_sync | line: 1174 | > PING 10 45 97 98 [binary, 4 bytes] | MainThread: 17344 DEBUG | 2024-08-08 10:13:46,871 | func: _heartbeat | line: 415 | sending keepalive message: {'type': 'KEEPALIVE', 'channel': 0} | MainThread: 17344 DEBUG | 2024-08-08 10:13:46,871 | func: write_frame_sync | line: 1174 | > TEXT '{"type": "KEEPALIVE", "channel": 0}' [35 bytes] | MainThread: 17344 DEBUG | 2024-08-08 10:14:02,337 | func: keepalive_ping | line: 1271 | ! timed out waiting for keepalive pong | MainThread: 17344 DEBUG | 2024-08-08 10:14:02,337 | func: fail_connection | line: 1409 | ! failing connection with code 1011 | MainThread: 17344 DEBUG | 2024-08-08 10:14:02,337 | func: fail_connection | line: 1433 | = connection is CLOSING | MainThread: 17344 DEBUG | 2024-08-08 10:14:02,337 | func: write_frame_sync | line: 1174 | > CLOSE 1011 (unexpected error) keepalive ping timeout [24 bytes] | MainThread: 17344 DEBUG | 2024-08-08 10:14:03,991 | func: connection_lost | line: 1494 | = connection is CLOSED | MainThread: 17344 DEBUG | 2024-08-08 10:14:16,888 | func: _heartbeat | line: 415 | sending keepalive message: {'type': 'KEEPALIVE', 'channel': 0} | MainThread: 17344

Graeme22 commented 1 month ago

It does look like that, but not quite for sure... It is something you've only experienced once? If you can reproduce it then it's likely a bug.

Vscheidell commented 1 month ago

I have experienced it twice, both times last week. I will monitor/try to reproduce and provide any updates.

On Fri, Aug 9, 2024 at 4:45 PM Graeme Holliday @.***> wrote:

It does look like that, but not quite for sure... It is something you've only experienced once? If you can reproduce it then it's likely a bug.

— Reply to this email directly, view it on GitHub https://github.com/tastyware/tastytrade/issues/161#issuecomment-2278793314, or unsubscribe https://github.com/notifications/unsubscribe-auth/BG6IS3ZUJWID27TF5BXXQ23ZQUZ53AVCNFSM6AAAAABMI4IDD6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZYG44TGMZRGQ . You are receiving this because you authored the thread.Message ID: @.***>