Merge pull request #80412 from hex108/concurrent_read_write

Add doc that plugins in bind cycle should not use scheduler NodeInfoSnapshot
This commit is contained in:
Kubernetes Prow Robot 2019-08-06 21:05:18 -07:00 committed by GitHub
commit a07992436d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -348,7 +348,10 @@ type FrameworkHandle interface {
// NodeInfoSnapshot return the latest NodeInfo snapshot. The snapshot
// is taken at the beginning of a scheduling cycle and remains unchanged until
// a pod finishes "Reserve" point. There is no guarantee that the information
// remains unchanged in the binding phase of scheduling.
// remains unchanged in the binding phase of scheduling, so plugins in the binding
// cycle(permit/pre-bind/bind/post-bind/un-reserve plugin) should not use it,
// otherwise a concurrent read/write error might occur, they should use scheduler
// cache instead.
NodeInfoSnapshot() *internalcache.NodeInfoSnapshot
// IterateOverWaitingPods acquires a read lock and iterates over the WaitingPods map.