eth-block-tracker icon indicating copy to clipboard operation
eth-block-tracker copied to clipboard

Endless failed request polling loop

Open Gudahtt opened this issue 2 years ago • 4 comments

The polling block tracker has been observed being stuck in an endless loop (e.g. https://github.com/MetaMask/metamask-extension/issues/17040).

I was able to reproduce this scenario by using MetaMask extension to switch to a network that will fail to respond to requests. This results in an endless loop of failed requests, even after switching away (i.e. even after there are no more listeners). In the debugger I confirmed that the only active listeners were internal to the block tracker itself (specifically this listener).

Gudahtt avatar Jul 15 '23 00:07 Gudahtt

I was still able to reproduce this bug on v9.0.3

Gudahtt avatar Jun 20 '24 18:06 Gudahtt

In the PR that is linked to in the timeline above and was closed, I made this comment:

@Gudahtt and I had a discussion and we feel like we can solve this a different way that doesn't involve listening to latest in any form.

@Gudahtt Do you still think following that route would be a proper fix here?

mcmire avatar Jun 26 '24 22:06 mcmire

Unfortunately I don't recall the details of that solution

Gudahtt avatar Jun 26 '24 22:06 Gudahtt

For clarity, a solution here would be to figure out a way to have the block tracker ignore internally-added listeners. More details here: https://consensys.slack.com/archives/C06FXU326RL/p1718910083555919?thread_ts=1718130645.943409&cid=C06FXU326RL

mcmire avatar Jul 18 '24 15:07 mcmire