ipfs / boxo

A set of reference libraries for building IPFS applications and implementations in Go.
https://github.com/ipfs/boxo#readme
Other
181 stars 83 forks source link

routing/http: fix goroutine/memory leak [skip changelog] #618

Closed MichaelMure closed 1 month ago

MichaelMure commented 1 month ago

I've noticed some memory and goroutine buildup, linked to that function.

It seems like when the context get cancelled, the consumer could be gone, but that function would still attempt to write in the channel and block forever.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 59.67%. Comparing base (625ba76) to head (b8219a9).

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #618      +/-   ##
==========================================
- Coverage   59.80%   59.67%   -0.13%     
==========================================
  Files         239      239              
  Lines       29961    29961              
==========================================
- Hits        17917    17880      -37     
- Misses      10427    10458      +31     
- Partials     1617     1623       +6     
Files Coverage Δ
routing/http/contentrouter/contentrouter.go 46.82% <60.00%> (-2.32%) :arrow_down:

... and 16 files with indirect coverage changes