diff --git a/pkg/quota/clusterquotareconciliation/reconciliation_controller.go b/pkg/quota/clusterquotareconciliation/reconciliation_controller.go index 4b435ac84..c2079bd7b 100644 --- a/pkg/quota/clusterquotareconciliation/reconciliation_controller.go +++ b/pkg/quota/clusterquotareconciliation/reconciliation_controller.go @@ -218,6 +218,7 @@ func (c *ClusterQuotaReconcilationController) Sync(discoveryFunc resourcequota.N if c.quotaMonitor != nil && !cache.WaitForCacheSync(ctx.Done(), func() bool { return c.quotaMonitor.IsSynced(context.TODO()) }) { utilruntime.HandleError(fmt.Errorf("timed out waiting for quota monitor sync")) } + klog.V(2).Infof("synced cluster resource quota controller") }, period, ctx.Done()) } diff --git a/pkg/quota/clusterquotareconciliation/workqueuebucket.go b/pkg/quota/clusterquotareconciliation/workqueuebucket.go index a98422208..926914eb7 100644 --- a/pkg/quota/clusterquotareconciliation/workqueuebucket.go +++ b/pkg/quota/clusterquotareconciliation/workqueuebucket.go @@ -4,6 +4,7 @@ import ( "sync" "k8s.io/client-go/util/workqueue" + "k8s.io/klog/v2" ) // BucketingWorkQueue gives a way to add items related to a single entry in a work queue @@ -46,6 +47,7 @@ func (e *workQueueBucket) AddWithData(key interface{}, data ...interface{}) { // this Add can trigger a Get BEFORE the work is added to a list, but this is ok because the getWork routine // waits the worklock before retrieving the work to do, so the writes in this method will be observed e.queue.Add(key) + klog.V(2).Infof("key %s is added with data into queue", key) if e.inProgress[key] { e.dirtyWork[key] = append(e.dirtyWork[key], data...) @@ -62,6 +64,7 @@ func (e *workQueueBucket) AddWithDataRateLimited(key interface{}, data ...interf // this Add can trigger a Get BEFORE the work is added to a list, but this is ok because the getWork routine // waits the worklock before retrieving the work to do, so the writes in this method will be observed e.queue.AddRateLimited(key) + klog.V(2).Infof("key %s is added rate limited with data into queue", key) if e.inProgress[key] { e.dirtyWork[key] = append(e.dirtyWork[key], data...) @@ -76,6 +79,8 @@ func (e *workQueueBucket) Done(key interface{}) { defer e.workLock.Unlock() e.queue.Done(key) + klog.V(2).Infof("key %s in the queue is marked as done", key) + e.work[key] = e.dirtyWork[key] delete(e.dirtyWork, key) delete(e.inProgress, key) @@ -91,12 +96,14 @@ func (e *workQueueBucket) GetWithData() (interface{}, []interface{}, bool) { return nil, []interface{}{}, shutdown } + klog.V(2).Infof("key %s is gotten from queue", key) e.workLock.Lock() defer e.workLock.Unlock() // at this point, we know we have a coherent view of e.work. It is entirely possible // that our workqueue has another item requeued to it, but we'll pick it up early. This ok // because the next time will go into our dirty list + klog.V(2).Infof("lock acquired and key % is added in progress list", key) work := e.work[key] delete(e.work, key) delete(e.dirtyWork, key)