client-go icon indicating copy to clipboard operation
client-go copied to clipboard

how to count processorListener.pendingNotifications length

Open lzlaa opened this issue 1 year ago • 2 comments

I want to know whether there are unhandled events of each event handler.

Is there any possible way to count the length of processorListener.pendingNotifications, without hacking the client-go libary.

// tools/cache/shared_informer.go:863
type processorListener struct {
	// ...

	handler ResourceEventHandler

	syncTracker *synctrack.SingleFileTracker

	// pendingNotifications is an unbounded ring buffer that holds all notifications not yet distributed.
	// There is one per listener, but a failing/stalled listener will have infinite pendingNotifications
	// added until we OOM.
	// TODO: This is no worse than before, since reflectors were backed by unbounded DeltaFIFOs, but
	// we should try to do something better.
	pendingNotifications buffer.RingGrowing

	// ...
}
### Tasks

lzlaa avatar Jan 03 '24 12:01 lzlaa