tracing: Fix panic on closed channel #24

Merged
fyrchik merged 1 commits from dstepanov-yadro/frostfs-api-go:fix/tracing-panic into master 2023-04-18 08:08:23 +00:00
1 changed files with 0 additions and 1 deletions

View File

@ -51,7 +51,6 @@ func NewGRPCStreamClientInterceptor() grpc.StreamClientInterceptor {
strWrp := newgRPCClientStream(str, desc, finished, done)
go func() {
defer close(finished)
fyrchik marked this conversation as resolved

Who will close it then?

Who will close it then?

No one will close this channel. After goroutine closes done channel no one can write to finished. After GC collects stream, it will be no readers and no writers. It's ok to leave channel open: https://groups.google.com/g/golang-nuts/c/pZwdYRGxCIk/m/qpbHxRRPJdUJ

No one will close this channel. After goroutine closes `done` channel no one can write to `finished`. After GC collects stream, it will be no readers and no writers. It's ok to leave channel open: https://groups.google.com/g/golang-nuts/c/pZwdYRGxCIk/m/qpbHxRRPJdUJ
defer close(done)
defer span.End()