Skip to content

[URGENT] Infinite loop in Connection._updateSubscriptions()  #3761

Description

@ncoquelet

Overview

Hi, we are using the Drift Protocol SDK (2.148.0), which underneath uses solana-web3.js (1.98.4) RpcWebSocketClient.
In production, the websocket connection is currently very unstable and that causes a storm of console.error messages on our instance.
Actually, this reaches the log rate limit of our provider

Railway rate limit of 500 logs/sec reached for replica, update your application to reduce the logging rate. Messages dropped: 13482
Railway rate limit of 500 logs/sec reached for replica, update your application to reduce the logging rate. Messages dropped: 11050

The same error is logged in an infinite loop before crashing our Railway instance.

accountUnsubscribe error: Tried to call a JSON-RPC method accountUnsubscribe but the socket was not CONNECTING or OPEN (readyState was 2)

I have noticed that it is caused by an infinite loop here

if (!isCurrentConnectionStillActive()) {

In my case, the call to accountUnsubscribe fails because the connection isn't open, but isCurrentConnectionStillActive() still says that the connection is alive, then recursively loop !!

Steps to reproduce

Difficult to say ...

Description of bug

Ask me anything I can do to provide more insights

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions