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
f616f067
Commit
f616f067
authored
Feb 06, 2017
by
Wojciech Tyczynski
Committed by
GitHub
Feb 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Avoid unnecessary copies in cacher"
parent
6f37347f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
cacher.go
staging/src/k8s.io/apiserver/pkg/storage/cacher.go
+5
-5
No files found.
staging/src/k8s.io/apiserver/pkg/storage/cacher.go
View file @
f616f067
...
...
@@ -752,7 +752,7 @@ func (c *errWatcher) Stop() {
type
cacheWatcher
struct
{
sync
.
Mutex
copier
runtime
.
ObjectCopier
input
chan
*
watchCacheEvent
input
chan
watchCacheEvent
result
chan
watch
.
Event
done
chan
struct
{}
filter
watchFilterFunc
...
...
@@ -763,7 +763,7 @@ type cacheWatcher struct {
func
newCacheWatcher
(
copier
runtime
.
ObjectCopier
,
resourceVersion
uint64
,
chanSize
int
,
initEvents
[]
*
watchCacheEvent
,
filter
watchFilterFunc
,
forget
func
(
bool
))
*
cacheWatcher
{
watcher
:=
&
cacheWatcher
{
copier
:
copier
,
input
:
make
(
chan
*
watchCacheEvent
,
chanSize
),
input
:
make
(
chan
watchCacheEvent
,
chanSize
),
result
:
make
(
chan
watch
.
Event
,
chanSize
),
done
:
make
(
chan
struct
{}),
filter
:
filter
,
...
...
@@ -800,7 +800,7 @@ var timerPool sync.Pool
func
(
c
*
cacheWatcher
)
add
(
event
*
watchCacheEvent
,
budget
*
timeBudget
)
{
// Try to send the event immediately, without blocking.
select
{
case
c
.
input
<-
event
:
case
c
.
input
<-
*
event
:
return
default
:
}
...
...
@@ -820,7 +820,7 @@ func (c *cacheWatcher) add(event *watchCacheEvent, budget *timeBudget) {
defer
timerPool
.
Put
(
t
)
select
{
case
c
.
input
<-
event
:
case
c
.
input
<-
*
event
:
stopped
:=
t
.
Stop
()
if
!
stopped
{
// Consume triggered (but not yet received) timer event
...
...
@@ -928,7 +928,7 @@ func (c *cacheWatcher) process(initEvents []*watchCacheEvent, resourceVersion ui
}
// only send events newer than resourceVersion
if
event
.
ResourceVersion
>
resourceVersion
{
c
.
sendWatchCacheEvent
(
event
)
c
.
sendWatchCacheEvent
(
&
event
)
}
}
}
...
...
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