1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-23 12:29:09 +00:00

Fix send to closed channel panic in watch (#817)

This commit is contained in:
Tom Lebreux
2025-09-10 15:09:25 -04:00
committed by GitHub
parent ca3fa10db5
commit 45a3b07816
2 changed files with 70 additions and 0 deletions

View File

@@ -399,6 +399,11 @@ func (l *ListOptionIndexer) Watch(ctx context.Context, opts WatchOptions, events
return nil
})
if err != nil {
// We might have added a watcher but the transaction failed in
// which case we still want to remove the watcher
if key != nil {
l.removeWatcher(key)
}
return err
}