-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API not disconnecting from the node #4829
Comments
The API will disconnect after the window is closed - the browser itself destroys the WebSocket object as well as the API objects creates, i.e. the page will not have resources attached after closing. On the server side, on the TCP layer, a disconnect would be sent as soon as the connection is destoyed. |
thanks @jacogr that is what i suspected, but then that doesnt explain why we are filling up connections so quickly This is the error from the node
Is it at all possible the browser closing isnt actually disconnecting? Where can I find logs of the disconnect? Also wouldnt it make sense to force the disconnect from the node, it seems like a potential DOS attack vector is someone floods the node with connections? 🤔 |
I certainly cannot replicate that locally, my setup -
So the node, at least on Substrate master, does drop correctly and the count matches up with my count of connections. I really cannot comment on the DOS vecctor on the Node side, I'm not familiar with the Rust internals of the jsonrpc crate (or the new |
Yes I am also able to replicate, and it does indeed close the connection
For anyone facing a similar issue, to identify whats happening on your node please run it with the below flag @jacogr feel free to close this issue if you want, but given others are facing a similar issue perhaps its best to keep it open until its resolved 🤔 |
Closing. This is not API related, there is no way the API can keep the connection open when the object is destroyed on the browser level, as explained above. |
No worries, I agree with you Thank you so much! |
One thing to check though - very recently in Substrate master, the RPC has been changed to |
ah nice! Do you mean on 0.9.19 or perhaps 0.9.20 We try not to use master because of dependency hell! |
For Polkadot, seems it will be in the 0.9.22 release, PR here - paritytech/substrate#8783 (I seem to have jumped the gun a bit with "it is released", although, like I said it has been running on a large number Kusama/Polkadot RPC nodes already for quite some time) |
Update to the update "when" - 0.9.22 will bring in jsonrpsee, see https://github.com/paritytech/polkadot/pull/5537/files |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query. |
Hi team, we are experiencing an issue where we our UI is going down because the node reaches capacity very quickly
I suspect our api is not disconnecting after window close
I see someone else on stack exchange facing a similar issue?
https://substrate.stackexchange.com/questions/1995/dev-substrate-node-at-capacity-for-ws-connections-how-to-flush
We tried setting a timeout of 60 seconds
Sadly thats also not working. FYI, We are on version 8.3.1
Any guidance on this? should we be managing the disconnect?
The text was updated successfully, but these errors were encountered: