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
4891eaa3
Unverified
Commit
4891eaa3
authored
May 17, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
May 17, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #77170 from smarterclayton/delay_queue_reentrant
DelayingQueue.ShutDown() should be reentrant
parents
df8e241f
d2f7eb52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
delaying_queue.go
...ing/src/k8s.io/client-go/util/workqueue/delaying_queue.go
+10
-4
No files found.
staging/src/k8s.io/client-go/util/workqueue/delaying_queue.go
View file @
4891eaa3
...
...
@@ -18,6 +18,7 @@ package workqueue
import
(
"container/heap"
"sync"
"time"
"k8s.io/apimachinery/pkg/util/clock"
...
...
@@ -66,6 +67,8 @@ type delayingType struct {
// stopCh lets us signal a shutdown to the waiting loop
stopCh
chan
struct
{}
// stopOnce guarantees we only signal shutdown a single time
stopOnce
sync
.
Once
// heartbeat ensures we wait no more than maxWait before firing
heartbeat
clock
.
Ticker
...
...
@@ -133,11 +136,14 @@ func (pq waitForPriorityQueue) Peek() interface{} {
return
pq
[
0
]
}
// ShutDown gives a way to shut off this queue
// ShutDown stops the queue. After the queue drains, the returned shutdown bool
// on Get() will be true. This method may be invoked more than once.
func
(
q
*
delayingType
)
ShutDown
()
{
q
.
Interface
.
ShutDown
()
close
(
q
.
stopCh
)
q
.
heartbeat
.
Stop
()
q
.
stopOnce
.
Do
(
func
()
{
q
.
Interface
.
ShutDown
()
close
(
q
.
stopCh
)
q
.
heartbeat
.
Stop
()
})
}
// AddAfter adds the given item to the work queue after the given delay
...
...
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