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
0129dede
Commit
0129dede
authored
Apr 20, 2019
by
Ted Yu
Committed by
Ted Yu
Apr 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use read lock for QuotaMonitor#IsSynced
parent
cee320a8
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 @
0129dede
...
...
@@ -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