Skip to content

Commit

Permalink
Follow code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
erni27 committed Apr 14, 2023
1 parent 12cf912 commit 247c972
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions internal/buffer/unbounded_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ func (s) TestMultipleWriters(t *testing.T) {
}
}

// TestClose makes sure that the buffer is closed after calling Close().
// TestClose closes the buffer and makes sure that nothing is sent after the
// buffer is closed.
func (s) TestClose(t *testing.T) {
ub := NewUnbounded()
ub.Close()
Expand All @@ -133,7 +134,4 @@ func (s) TestClose(t *testing.T) {
t.Errorf("Unbounded.Get() = %v, want closed channel", v)
}
ub.Close()
if v, ok := <-ub.Get(); ok {
t.Errorf("Unbounded.Get() = %v, want closed channel", v)
}
}
2 changes: 1 addition & 1 deletion xds/internal/balancer/outlierdetection/balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,10 @@ func (b *outlierDetectionBalancer) Close() {
b.pickerUpdateCh.Close()

b.mu.Lock()
defer b.mu.Unlock()
if b.intervalTimer != nil {
b.intervalTimer.Stop()
}
b.mu.Unlock()
}

func (b *outlierDetectionBalancer) ExitIdle() {
Expand Down
2 changes: 1 addition & 1 deletion xds/internal/xdsclient/transport/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ func (t *Transport) send(ctx context.Context) {
sendNodeProto = false
case u, ok := <-t.adsRequestCh.Get():
if !ok {
// No requests will be sent after the unbounded buffer is closed.
// No requests will be sent after the adsRequestCh buffer is closed.
return
}
t.adsRequestCh.Load()
Expand Down

0 comments on commit 247c972

Please sign in to comment.