mirror of
https://github.com/kubernetes/client-go.git
synced 2025-12-25 06:02:30 +00:00
Change: - refactor Reflector.ListAndWatch and Reflector.watch to always call watcher.Stop. - refactor Reflector.handleAnyWatch to always call watcher.Stop, EXCEPT when exitOnWatchListBookmarkReceived && watchListBookmarkReceived. - Update unit tests with these new expectations. Effect: - ensures watcher.Stop is always called at least once - avoids deadlocks in watcher implementations when watcher.Watch is called, but watcher.Stop is never called. Note: It's impossible to guarantee that Stop will only be called once. So watch.Interface implementations must tollerate Stop being called multiple times. Kubernetes-commit: 3e609ecf6e945bf4562bddfc563fde9a4c3d0d90