mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-10-31 18:28:13 +00:00 
			
		
		
		
	Fix resource quota controller shutting down its worker threads
This commit is contained in:
		| @@ -163,11 +163,10 @@ func (rq *ResourceQuotaController) enqueueResourceQuota(obj interface{}) { | ||||
| // worker runs a worker thread that just dequeues items, processes them, and marks them done. | ||||
| // It enforces that the syncHandler is never invoked concurrently with the same key. | ||||
| func (rq *ResourceQuotaController) worker() { | ||||
| 	for { | ||||
| 		func() { | ||||
| 	workFunc := func() bool { | ||||
| 		key, quit := rq.queue.Get() | ||||
| 		if quit { | ||||
| 				return | ||||
| 			return true | ||||
| 		} | ||||
| 		defer rq.queue.Done(key) | ||||
| 		err := rq.syncHandler(key.(string)) | ||||
| @@ -175,7 +174,13 @@ func (rq *ResourceQuotaController) worker() { | ||||
| 			utilruntime.HandleError(err) | ||||
| 			rq.queue.Add(key) | ||||
| 		} | ||||
| 		}() | ||||
| 		return false | ||||
| 	} | ||||
| 	for { | ||||
| 		if quit := workFunc(); quit { | ||||
| 			glog.Infof("resource quota controller worker shutting down") | ||||
| 			return | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 derekwaynecarr
					derekwaynecarr