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
a30c0f47
Commit
a30c0f47
authored
Nov 06, 2017
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apiserver: fix Cacher.Stop() race
parent
21062657
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
cacher.go
staging/src/k8s.io/apiserver/pkg/storage/cacher.go
+5
-3
No files found.
staging/src/k8s.io/apiserver/pkg/storage/cacher.go
View file @
a30c0f47
...
@@ -649,13 +649,15 @@ func (c *Cacher) isStopped() bool {
...
@@ -649,13 +649,15 @@ func (c *Cacher) isStopped() bool {
}
}
func
(
c
*
Cacher
)
Stop
()
{
func
(
c
*
Cacher
)
Stop
()
{
// TODO : Do not check for isStopped (and return) when PR
// avoid stopping twice (note: cachers are shared with subresources)
// https://github.com/kubernetes/kubernetes/pull/50690
// merges as that shuts down storage properly
if
c
.
isStopped
()
{
if
c
.
isStopped
()
{
return
return
}
}
c
.
stopLock
.
Lock
()
c
.
stopLock
.
Lock
()
if
c
.
stopped
{
// avoid that it was locked meanwhile as isStopped only read-locks
return
}
c
.
stopped
=
true
c
.
stopped
=
true
c
.
stopLock
.
Unlock
()
c
.
stopLock
.
Unlock
()
close
(
c
.
stopCh
)
close
(
c
.
stopCh
)
...
...
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