-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buffer & grpcsync: various cleanups and improvements #6785
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #6785 +/- ##
==========================================
+ Coverage 83.24% 83.33% +0.08%
==========================================
Files 285 285
Lines 30950 30937 -13
==========================================
+ Hits 25765 25782 +17
+ Misses 4099 4074 -25
+ Partials 1086 1081 -5
|
if len(b.backlog) > 0 { | ||
select { | ||
case b.c <- b.backlog[0]: | ||
b.backlog[0] = nil | ||
b.backlog = b.backlog[1:] | ||
default: | ||
} | ||
} else if b.closing && !b.closed { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For correctness sake and to ensure that an extra call to Load()
does not close a closed channel, we should set to b.closed
to true
here.
closed bool | ||
closing bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to move these fields to be under the mu
since they are clearly accessed always only with the mutex.
RELEASE NOTES: none