You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2021/09/19 15:27:46 UTC

[GitHub] [incubator-yunikorn-k8shim] 0yukali0 edited a comment on pull request #301: [YUNIKORN-552] Add some unit tests to cover placeholder cleanup

0yukali0 edited a comment on pull request #301:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/301#issuecomment-922491753


   Hi @kobe860219 
   1.orphanPods is accessed by  cleanOrphanPlaceholders and len(mgr.orphanPods) same time.
   You need a lock to protect this variable.
   > func (mgr *PlaceholderManager) GetorphanPodsLength {
     mgr.Lock()
     defer mgr.Unlock()
     return len(mgr.orphanPods)
   }
   
   2.cleanupTime is also accessed  to write and read same time.
   make sure this variable is accessed by only one process at one time.
   > func (mgr *PlaceholderManager) GetCleanupTime {
     mgr.Lock()
     defer mgr.Unlock()
     return mgr.cleanupTime
   }
   
   > func (mgr *PlaceholderManager) SetCleanupTime {
     mgr.Lock()
     defer mgr.Unlock()
     mgr.cleanupTime = 5 * time.Second
   }
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org