hemilabs / heminetwork

The hemi network core daemons.
MIT License
67 stars 42 forks source link

check for ctx.Done() when using request limiter #244

Closed ClaytonNorthey92 closed 2 months ago

ClaytonNorthey92 commented 2 months ago

Summary debugging with @joshuasing , we were noticing in pprof output that we have many goroutines hanging at the request limiter, we then realized that we don't stop waiting if the request's context is done. therefore we (very likely) have a bunch of goroutines with "done" contexts that are hanging and hogging resources

Changes when using the request limiter, ensure that we don't continue to wait on a context that is done