yarpc / yarpc-go

A message passing platform for Go
MIT License
401 stars 101 forks source link

tls: fix connection close on listener close #2206

Closed DheerendraRathor closed 1 year ago

DheerendraRathor commented 1 year ago

In serveConnection, closing the muxed connection instead of underlying net.Conn to properly release resources. Muxed connection can be *tls.Conn and should be closed properly.

Other minor change is close the stoppedChan in serve at the end as closing it will unblock read in Close and will effectively close the listener. This should be the last logical instruction during close.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 50.00% and project coverage change: -0.01 :warning:

Comparison is base (e3ff3d8) 85.35% compared to head (5c18790) 85.34%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #2206 +/- ## ========================================== - Coverage 85.35% 85.34% -0.01% ========================================== Files 270 270 Lines 15475 15475 ========================================== - Hits 13208 13207 -1 - Misses 1845 1846 +1 Partials 422 422 ``` | [Impacted Files](https://codecov.io/gh/yarpc/yarpc-go/pull/2206?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc) | Coverage Δ | | |---|---|---| | [transport/internal/tls/muxlistener/listener.go](https://codecov.io/gh/yarpc/yarpc-go/pull/2206?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc#diff-dHJhbnNwb3J0L2ludGVybmFsL3Rscy9tdXhsaXN0ZW5lci9saXN0ZW5lci5nbw==) | `93.87% <50.00%> (-2.05%)` | :arrow_down: | ... and [2 files with indirect coverage changes](https://codecov.io/gh/yarpc/yarpc-go/pull/2206/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc) Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.