Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(stream): wrap close done ch with sync.Once (#2537)
Today, `stream.Stream` is structured as: ```go case <-streamer.Done(): // call Close() case <-time.After(fetchDelay): // call Fetch() ``` The problem is that it's possible that the `Done()` event is triggered at the same time as `time.After(fetchDelay)` and in that scenario the behavior is undeterministic. It's possible that we call `Fetch` a second time. For the ECS deployment streamer, this means that we would previous close the `s.done` channel twice. Wrapping the call with a `sync.Once` removes this concern. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
- Loading branch information