Commit Graph

7 Commits

Author SHA1 Message Date
Jordan Liggitt
a3cad0dc91 Clean up leaked goroutines in cache unit tests
Kubernetes-commit: 6747bf7a9cb3009aae4cba1e1d249d56a66a981b
2025-04-01 13:59:32 -04:00
David Eads
52af3bdc0f Remove cache.ErrRequeue
cache.ErrRequeue advertised itself as a way to requeue failures on a
FIFO, but it suffers the same problems as AddIfNotPresent.  If we do
requeue an item at the end, we'll move the informer back in time.  If we
requeue at the beginning we'll simply wedge FIFO.

We didn't find examples in the wild, but by removing the error type
those impacted will get a compile error and get to decide what action is
most appropriate for their failure.  Most of the time, proceeding to the
next item is best.

Kubernetes-commit: 238c32a1d9b2c72d648193fa8642a53a2884975f
2025-01-20 13:59:43 -05:00
David Eads
d853ccf18c Remove Queue.AddIfNotPresent
Logically a cache.Queue.AddIfNotPresent means that the informer can move
back in time since an older item is placed after newer items.  The
alternative of placing errors at the head of the queue leads to
indefinite memory growth and repeated failures on retry.

Luckily this behavior was behind RetryOnError, which was always set to
false and impossible for normal users to set to true.  By removing the
function and setting, impacted users (none found in a github search)
will get a compile failure.

Kubernetes-commit: 8e77ac000131019d5aa49c19aa1f477f6dac4d59
2025-01-20 13:54:32 -05:00
David Eads
f29637f7f2 shrink the cache.Queue interface to what is actually used
Kubernetes-commit: 0ddab1694579d523e3865c75ca44d6cdf1b0ef93
2025-01-08 15:31:47 -05:00
Daniel Smith
5d70a118df Enable propagration of HasSynced
* Add tracker types and tests
* Modify ResourceEventHandler interface's OnAdd member
* Add additional ResourceEventHandlerDetailedFuncs struct
* Fix SharedInformer to let users track HasSynced for their handlers
* Fix in-tree controllers which weren't computing HasSynced correctly
* Deprecate the cache.Pop function

Kubernetes-commit: 8100efc7b3122ad119ee8fa4bbbedef3b90f2e0d
2022-11-18 00:12:50 +00:00
dopelsunce
73aa499de0 Fix race condition between Pop and Close FIFO queue
Fixes: kubernetes#90581 (the first part)

When `Close()` is invoked on an empty queue, the control loop inside `Pop()` has a small chance of missing the signal and blocks indefinitely due to a race condition. This PR eliminates the race and allows the control loop inside any blocking `Pop()` to successfully exit after Close() is called.

Kubernetes-commit: d8b90955519d10b99415515f8314dd6d35caae8d
2020-05-06 19:01:13 -05:00
Chao Xu
a6d206121d remove the top-level folders for versions
remove scripts
2016-10-19 14:34:19 -07:00