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
Multiple issues with unsubscribe #2669
Comments
…rver-side ID (gakonst#2669) Also add a test which calls unsubscribe.
@gbrew thanks for digging looks like you fixed that on your branch? |
No problem -- I actually opened a PR for this right after the bug, but it looks like it didn't get linked here. Please have a look at #2670 . I'm noticing that several of the CI tasks failed, but from a quick look they seem unrelated to my changes. |
@mattsse Who's the right person to ask to take a look at this? Would like to get it merged if appropriate, as I'm still seeing this issue and it looks like the alloy replacement isn't quite ready. |
…rver-side ID (gakonst#2669) Also add a test which calls unsubscribe.
Version
All crates are v2.0.10 as of commit e0e79df
Platform
Macos Darwin Kernel Version 22.6.0, Ubuntu with kernel version 5.15.0-86-generic
Description
There are multiple issues preventing ethers unsubscription from working. The end result is that the rpc server does not get proper eth_unsubscribe calls, so the subscriptions are not cancelled on the server. This leads to problems if the server enforces a maximum number of live subscriptions per connection.
For example, this code will never unsubscribe and eventually run out of subscriptions:
This also happens when relying on the drop() implementation for SubscriptionStream to clean up when a SubscriptionStream goes out of scope.
There are several distinct issues here:
I've observed these issues for the ws client by watching the connection in wireshark.
I am putting together a pull request to deal with all of the above by making all unsubscribe calls (both explicit via SubscriptionStream::unsubscribe() and implicit via SubscriptionStream::drop()) call through PubsubClient::unsubscribe(), fixing the ws implementation of that to properly format the rpc request, and adding eth_unsubscribe calls in the IPC and ws-legacy clients. Let me know if this approach makes sense and I can put that up for review soon.
The text was updated successfully, but these errors were encountered: