mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 09:52:49 +00:00
Merge pull request #112476 from enj/enj/i/list_pager_flake
Check for context cancellation on each buffered chunk
This commit is contained in:
commit
be506dc46e
@ -203,6 +203,11 @@ func (p *ListPager) eachListChunkBuffered(ctx context.Context, options metav1.Li
|
||||
}()
|
||||
|
||||
for o := range chunkC {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
default:
|
||||
}
|
||||
err := fn(o)
|
||||
if err != nil {
|
||||
return err // any fn error should be returned immediately
|
||||
|
Loading…
Reference in New Issue
Block a user