livepeer / catalyst-api

MIT License
4 stars 2 forks source link

Lock for the whole of GetState() to avoid parallel mist API calls #1293

Closed mjh1 closed 2 months ago

mjh1 commented 4 months ago

I was still observing hundreds of mist API calls being made on startup, much better than the thousands we had before but it still has the potential to blow up. This should fix that issue.

The cache uses a RWMutex which means multiple routines can end up with a cache miss at the same time and therefore calling through to the mist API. We want to avoid this and have the other routines wait so we lock for the whole of the GetState function.

mjh1 commented 2 months ago

Didn't end up needing this. It can be revived if necessary at a later date