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

Related TrueCloudLab/frostfs-node#263

Closed channel is also ready for communication, so select statement can write to it.

Related https://git.frostfs.info/TrueCloudLab/frostfs-node/issues/263 Closed channel is also ready for communication, so select statement can write to it.
dstepanov-yadro force-pushed fix/tracing-panic from e5dd1004a1 to 30c5a0f55c 2023-04-18 07:48:21 +00:00 Compare
dstepanov-yadro requested review from storage-core-committers 2023-04-18 07:48:40 +00:00
dstepanov-yadro requested review from storage-core-developers 2023-04-18 07:48:40 +00:00
fyrchik reviewed 2023-04-18 07:50:48 +00:00
@ -51,7 +51,6 @@ func NewGRPCStreamClientInterceptor() grpc.StreamClientInterceptor {
strWrp := newgRPCClientStream(str, desc, finished, done)
go func() {
defer close(finished)

Who will close it then?

Who will close it then?
Poster
Collaborator

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
fyrchik marked this conversation as resolved
fyrchik merged commit bd44a3f47b into master 2023-04-18 08:08:23 +00:00

Sorry, pressed merge button mechanically without enough approvals.

Sorry, pressed merge button mechanically without enough approvals.
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-committers
TrueCloudLab/storage-core-developers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-api-go#24
There is no content yet.