Will Kubernetes' client-go delta_fifo type cause deletion notifications to be missed?

1/23/2018

I'm working on understanding delta_fifo.go in depth from the client-go project. I'm looking at a situation where maybe reports of resource deletions might get dropped.

I'm 98% biased in favor of my own failing to read the code properly, but it seems to me that Delete() will skip a deletion if it doesn't find an appropriate "event queue" (my term for Deltas), and Pop() will remove an event queue that it is processing, even if, say, the last event in the queue is an addition, update or synchronization.

Suppose you begin with an empty set of event queues (an empty queue and empty items) and then you get the following and only the following:

Won't Delete() skip broadcasting the deletion, since the relevant event queue no longer exists? So since queueActionLocked() won't be called in this case, then doesn't it follow that any downstream ResourceEventListeners will never be notified of this deletion?

Relatively stable links to code in question:

Any help greatly appreciated; thanks!

-- Laird Nelson
kubernetes

1 Answer

1/23/2018

The path you highlighted in Delete() is only called when knownObjects is nil. The documentation for that option indicates it is used to determine what objects the consumer of the queue is aware of and if nil, indicates the consumer does not care about detecting all deletions

https://github.com/kubernetes/kubernetes/blob/v1.9.0/staging/src/k8s.io/client-go/tools/cache/delta_fifo.go#L39-L42

-- Jordan Liggitt
Source: StackOverflow