-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Problem
I'm using the version 1.44.1 of @solana/web3.js, to develop an application with high-frequency calling.
And the connection between network on my machine and Solana' Network seems to be not so stable: it's often to throw error about transaction confirmation timeout
In this situation, it suddenly to fastly and infinitely throw errors like follow:

Here is the key log:
signatureSubscribe error for argument [
'5R9WXhnHtz5umHHh9LpXXz9CSXjucTbrUPCJV2iQAkUgBX4jQ4UcQYRyta3LbBFZwuMGcKMaqCPiPkyuPT2JPKSr',
{ commitment: 'processed' }
] WebSocket is not open: readyState 0 (CONNECTING)
As you can see, the connection is frantically trying to build up subscriptions on TWO transaction signatures.
Then I found out, the problem was caused in function _updateSubscriptions() in connection.ts:

Proposed Solution
Maybe you team should fix the logic of error handling. Here's my humble opinion: if there are some subsciptions failing for too many times(whatever the reason is), they should be directly removed from subscriptions list.