Files
client-go/tools/cache
Odin Ugedal 97cf9cb9c2 client-go/cache: fix missing delete event on replace
This fixes a race condition when a "short lived" object
is created and the create event is still present on the queue
when a relist replaces the state. Previously that would lead in the
object being leaked.

The way this could happen is roughly;

1. new Object is added O, agent gets CREATED event for it
2. watch is terminated, and the agent runs a new list, L
3. CREATE event for O is still on the queue to be processed.
4. informer replaces the old data in store with L, and O is not in L
  - Since O is not in the store, and not in the list L, no DELETED event
    is queued
5. CREATE event for O is still on the queue to be processed.
6. CREATE event for O is processed
7. O is <leaked>; its present in the cache but not in k8s.

With this patch, on step 4. above it would create a DELETED event
ensuring that the object will be removed.

Signed-off-by: Odin Ugedal <ougedal@palantir.com>
Signed-off-by: Odin Ugedal <odin@uged.al>

Kubernetes-commit: bd4ec0acec8844bddc7780d322f8fc215d045046
2023-02-08 14:57:23 +00:00
..
2022-02-11 14:50:19 -05:00
2022-07-19 20:54:13 -04:00
2016-10-21 04:44:19 +00:00
2022-07-19 20:54:13 -04:00
2022-07-19 20:54:13 -04:00
2020-01-27 18:19:44 -08:00
2019-01-30 15:27:39 +11:00
2022-01-03 10:59:47 -05:00
2022-09-22 14:42:41 +08:00
2022-06-22 11:26:07 +08:00