provider stops/hangs for no reason
See original GitHub issueEthers Version
5.6.1
Search Terms
hangs,provider,block
Describe the Problem
I use the following code with AlchemyWebsocket provider.
provider.on('block', async (blockNumber: number) => {
const logs = await provider.getLogs(someFilter);
// process logic
}
I run this in ECR container on AWS. Ideally, this should run continuously to listen to every block. The problem is that after some random hours it hangs and stops listening.
It doesn’t even log any errors. And it doesn’t seem like something to do with container memories etc. What’s interesting is that the health check endpoint that is exposed returns 200 OK responses, even after the provider stops listening - which means the docker container is still running.
It normally happens after 5-6 hours but in general, the timing is more or less random.
Code Snippet
No response
Contract ABI
No response
Errors
No response
Environment
node.js (older than v12)
Environment (Other)
docker, docker compose, AWS ECR
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Black Screen and System Restart with Even ID 41
Hi Guyz , My system suddenly stops / hangs and goes black and restarts . I updated driver / OS . Still my...
Read more >Can My Doctor Stop Treating Me For No Reason?
Yes, your doctor can stop treating you for any non-discriminatory reason. However…(there's always conditions), there is a protocol that should be followed ...
Read more >Unable to install RHEL 8 - Red Hat Customer Portal
I just tried both DVD iso and boot ISO. Boot iso is not connecting to wifi just staying on connecting (forever).
Read more >3G connection frequently stops/hangs | Page 3 | XDA Forums
the reason we cannot stay on hsdpa and are transfered to 3g is because providers don't want idle connections clogging up their fast...
Read more >Unable to Perform a System Update - Soporte de Nintendo
The system update stops, hangs, or freezes. ... Wireless interference can cause your Wii U Internet connection to time out during the update....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ricmoo we’re running into this issue as well when using alchemy. the proximate cause is that their server fails for some reason, which i’m investigating with them.
but the underlying problem is that there is something in the
getLogs
call to a websocket provider that causes the process to hang and increase memory consumption constantly.Is it possible to implement some kind of reconnect logic upon timeout if the socket hangs?