Websocket connection is disconnecting using lseg.data library

brg
brg Newcomer

Hi,

I am using v2.1.1 of the lseg.data Python library to stream realtime data.

My setup is working most of the time, but once in a while (every few days, but no set pattern), the websocket disconnects for ~2 seconds, during which I lose data.

I have identified one such event and captured the logs surrounding the event, attached.
Can someone please help me diagnose what the issue is?

I only using the lseg.data library, so all the connection / reconnection logic is handled by this library. The only thing I'm doing is starting a stream and letting it run.

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @brg

    Thank you for reaching out to us.

    I have done a quick test and found that the library could reconnect and re-subscribe to items properly.

    I found that the stream ID reaches 11940.

    2025-08-11 01:54:05,523 - DEBUG - sessions.platform.default.0 - [OMMSTREAMING_PRICING_0.0] send {"ID": 11940, "Domain": "MarketPrice", "Streaming": true, "Key": {"Name": "LCOX5-J6"}}

    Does the application subscribe to a lot of items?

    You may contact the server team via LSEG Support to verify if the server cut the connection. Please include the URL of this discussion in your raised question to prevent it from being redirected back to this Q&A forum.

    The library may not perform well when subscribing to a large number of streaming items. Please refer to the Choosing a Real-time Streaming API article for more information.

  • brg
    brg Newcomer

    Hi @Jirapongse thank you for looking into this.

    My application subscribes to up to ~2000 instruments - would you say that this is too many for the lseg.data library to handle?

    I will reach out to LSEG support to see if they have any more insights.

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @brg

    It depends on the total of update rates of those instruments.

    Did you see the following log in the log file?

    [2025-08-13T14:11:10.681148+07:00] - [sessions.platform.deployed.0] - [DEBUG] - [35184 - Msg-Proc-ThreadOMMSTREAMING_PRICING_0.0] - [stream_connection] - [_get_messages] - [OMMSTREAMING_PRICING_0.0] received messages: 8 | processed messages: 8

    You may consider disabling the debug log, as it can negatively affect the application's performance.

  • brg
    brg Newcomer

    @Jirapongse

    Yes, I have checked that received messages = processed messages. Just before the last disconnection I have in my logs:

    received messages: 21256975 | processed messages: 21256975

    I only enabled the debug logs because of this disconnection issue. Previously I had them disabled, but kept getting disconnected, which is why I turned them on.

    I also contacted the support team and they say that it was a client-side disconnection. The logs from their side are pasted below.

    Since I am using the lseg.data library, I am not handling any ping / reconnects myself. Is there anything else I can do to further diagnose this?

    <ads-fanout-sm-az1-apse1-prd.1.ads:Info:Thu Aug 14 13:31:35.041971 2025> WS JSON2 disconnect from "GE-******" at position "10.1.210.54/lseg-realtime-acquisition-staging-7959d67c6d-h4w9z" on host "" and port number "19418" using application "256" on channel 73 (Client-side initiated disconnection). Reason:rsslRead() failed with code -1 and system error 0. Text:WS Code 1000 Normal Closure <END> <ads-fanout-sm-az2-apne1-prd.1.ads:Info:Wed Aug 13 18:12:08.269419 2025> WS JSON2 disconnect from "GE-******" at position "10.1.210.54/lseg-realtime-acquisition-staging-7959d67c6d-h4w9z" on host "" and port number "58125" using application "256" on channel 73 (Client-side initiated disconnection). Reason:rsslRead() failed with code -1 and system error 11. Text:<rwsReadTransportMsg:4444> Error:1002ipcRead() failure. System errno: (11)<END>

    <ads-fanout-sm-az2-euw1-prd.1.ads:Info:Wed Aug 13 07:46:06.497160 2025> WS JSON2 disconnect from "GE-******" at position "10.1.210.45/lseg-volume-stream-5778f9bb47-v6m48" on host "" and port number "57606" using application "256" on channel 185 (Server-side initiated disconnection). Reason:Client application did not ping. <END>

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @brg

    There are both Client-side initiated disconnection and Server-side initiated disconnection.

    Do you have the full debug log files when the problem occurred?

    If yes, please share those files. We can check the ping/pong messages from the debug log files.

    [2025-08-15T17:14:21.675195+07:00] - [sessions.platform.ldpv2.0] - [DEBUG] - [35244 - Msg-Proc-ThreadOMMSTREAMING_PRICING_0.0] - [omm_stream_connection] - [_process_message] - [OMMSTREAMING_PRICING_0.0] process message {"Type": "Ping"}
    [2025-08-15T17:14:21.675195+07:00] - [sessions.platform.ldpv2.0] - [DEBUG] - [35244 - Msg-Proc-ThreadOMMSTREAMING_PRICING_0.0] - [stream_connection] - [send_message] - [OMMSTREAMING_PRICING_0.0] send {"Type": "Pong"}