Closed RouquinBlanc closed 4 months ago
Attention: Patch coverage is 42.30769%
with 15 lines
in your changes are missing coverage. Please review.
Project coverage is 55.57%. Comparing base (
f8d2343
) to head (fa24957
).
Files | Patch % | Lines |
---|---|---|
internal/protocols/webrtc/whip_client.go | 0.00% | 15 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
~Second part seems to do the trick!~
Still leaking... Same thing, it's just slow to build up
Seems fine now (running 20 minutes and no increase).
It looks like the HTTPClient keeps idle open connections for future requests and does not clean them up unless CloseIdleConnections() is called. They would eventually die out, but that depends on GC and/or remote side closing, which is not ideal.
🤞
Thanks for this patch, i did the following changes:
http.Client.CloseIdleConnections()
outside WHIPClient
, since the HTTP Client is not meant as a managed component of WHIPClient
but as an external component that may be shared with other entities, therefore WHIPClient
should not perform actions that may interfere with other entitiesWHIPClient.Publish()
and WHIPClient.Read()
in order to automatically call WHIPClient.Close()
, therefore calling it manually should not be necessary anymoreI agree with you on the fact that http.Client.CloseIdleConnections()
should be called whenever a http.Client
is not in use anymore, i'll edit the server in order to add this in all other places where http.Client
is in use.
This has been merged, thanks!
This issue is mentioned in release v1.7.0 🚀 Check out the entire changelog by clicking here
Tentative fix for #3118
It still leaks, but less; Here is what remains leaking: