Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
b03e4bbc
Unverified
Commit
b03e4bbc
authored
May 01, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
May 01, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #76868 from tedyu/res-quota-mon-read
Use read lock for QuotaMonitor#IsSynced
parents
de83eefd
0129dede
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
resource_quota_monitor.go
pkg/controller/resourcequota/resource_quota_monitor.go
+3
-3
No files found.
pkg/controller/resourcequota/resource_quota_monitor.go
View file @
b03e4bbc
...
...
@@ -69,7 +69,7 @@ type event struct {
type
QuotaMonitor
struct
{
// each monitor list/watches a resource and determines if we should replenish quota
monitors
monitors
monitorLock
sync
.
Mutex
monitorLock
sync
.
RW
Mutex
// informersStarted is closed after after all of the controllers have been initialized and are running.
// After that it is safe to start them here, before that it is not.
informersStarted
<-
chan
struct
{}
...
...
@@ -280,8 +280,8 @@ func (qm *QuotaMonitor) StartMonitors() {
// true at one time, and then later return false if all monitors were
// reconstructed.
func
(
qm
*
QuotaMonitor
)
IsSynced
()
bool
{
qm
.
monitorLock
.
Lock
()
defer
qm
.
monitorLock
.
Unlock
()
qm
.
monitorLock
.
R
Lock
()
defer
qm
.
monitorLock
.
R
Unlock
()
if
len
(
qm
.
monitors
)
==
0
{
klog
.
V
(
4
)
.
Info
(
"quota monitor not synced: no monitors"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment