Skip to content
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

Edge case with wsV2 and high throughput subscriptions #3221

Open
fselmo opened this issue Feb 5, 2024 · 0 comments
Open

Edge case with wsV2 and high throughput subscriptions #3221

fselmo opened this issue Feb 5, 2024 · 0 comments

Comments

@fselmo
Copy link
Collaborator

fselmo commented Feb 5, 2024

What was wrong?

  • There's an edge case for WebsocketProvider (V2) with high throughput subscriptions (e.g. newPendingTransactions) where if there is even a single call for each transaction, there is enough wait time on calls where the subscription queue will get backed up and eventually the _listen_event will trigger and not work as it should. It basically bricks the listener task and the only current way to bandaid "fix" it is to increase the cache size - though this isn't sustainable because it will eventually fill up to that higher number as well and brick again.

How can it be fixed?

Look into the way the _listen_event (asyncio.Event) is working and figure out a good way for the waiting to work with this scenario of a full subscription queue that keeps getting more full. Maybe wait until the queue is half full to start listening to messages again? An arbitrary wait time like 1 second? We'll have to play around with this and find a good balance.

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

No branches or pull requests

2 participants