Files
client-go/tools/cache
David Bimmler 6294eedf76 cache: do not allocate chan for nothing (#133500)
* cache: do not allocate chan for nothing

The explicit purpose of this channel is to never be closed and nothing
to be sent down on it. Hence, there's no need to allocate a channel - a
nil channel has exactly the desired behaviour.

Additionally, this is more relevant now that testing/synctest gets
unhappy when goroutines are blocked on reading on channels which are
created outside of the synctest bubble. Since this is a package var, that's
hard to avoid when using this package. Synctest is fine with nil
channels though.

Reported-by: Jussi Maki <jussi@isovalent.com>
Signed-off-by: David Bimmler <david.bimmler@isovalent.com>

* handlers: do not allocate chan for nothing

Nil chan has the desired semantics already, and this breaks
testing/synctest because the channel is allocated outside of the bubble.

Signed-off-by: David Bimmler <david.bimmler@isovalent.com>

---------

Signed-off-by: David Bimmler <david.bimmler@isovalent.com>

Kubernetes-commit: 52b7d035f9655d0c6ebeaaafd60add99700bb468
2025-08-28 03:53:15 +00:00
..
2022-02-11 14:50:19 -05:00
2025-06-27 00:49:02 +09:00
2025-06-26 23:49:25 +09:00
2024-12-02 14:43:58 +01:00
2025-06-26 23:49:25 +09:00
2025-06-26 23:49:34 +09:00
2024-08-17 13:00:07 -04:00
2025-06-26 23:49:25 +09:00