Skip to content

Commit

Permalink
Fix data races in galley/pkg/config/source (istio#16719)
Browse files Browse the repository at this point in the history
* Fix races in code.

* fix lint error.
  • Loading branch information
ozevren authored and istio-testing committed Sep 3, 2019
1 parent 3188d1a commit f10e25f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions galley/pkg/config/source/kube/fs/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ func (s *source) Start() {
if s.done != nil {
return
}
s.done = make(chan struct{})
done := make(chan struct{})
s.done = done

c := make(chan appsignals.Signal, 1)
appsignals.Watch(c)
Expand All @@ -86,7 +87,7 @@ func (s *source) Start() {
scope.Source.Infof("[%s] Triggering reload in response to: %v", s.name, trigger.Source)
s.reload()
}
case <-s.done:
case <-done:
return
}
}
Expand Down
2 changes: 1 addition & 1 deletion galley/pkg/config/testing/fixtures/expect.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func ExpectFilter(t *testing.T, acc *Accumulator, fn FilterFn, expected ...event
g := gomega.NewGomegaWithT(t)

wrapFn := func() []event.Event {
e := acc.events
e := acc.Events()
if fn != nil {
e = fn(e)
}
Expand Down

0 comments on commit f10e25f

Please sign in to comment.