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
9b2886df
Commit
9b2886df
authored
Nov 27, 2017
by
Dan Mace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure sync failures are correctly retried
Only track the last synced resources when all preceding steps have completed to ensure that failures will be correctly retried.
parent
d89f58fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
garbagecollector.go
pkg/controller/garbagecollector/garbagecollector.go
+7
-2
No files found.
pkg/controller/garbagecollector/garbagecollector.go
View file @
9b2886df
...
@@ -179,9 +179,8 @@ func (gc *GarbageCollector) Sync(discoveryClient discovery.DiscoveryInterface, p
...
@@ -179,9 +179,8 @@ func (gc *GarbageCollector) Sync(discoveryClient discovery.DiscoveryInterface, p
return
return
}
}
// Something has changed,
so track the new state and perform a
sync.
// Something has changed,
time to
sync.
glog
.
V
(
2
)
.
Infof
(
"syncing garbage collector with updated resources from discovery: %v"
,
newResources
)
glog
.
V
(
2
)
.
Infof
(
"syncing garbage collector with updated resources from discovery: %v"
,
newResources
)
oldResources
=
newResources
// Ensure workers are paused to avoid processing events before informers
// Ensure workers are paused to avoid processing events before informers
// have resynced.
// have resynced.
...
@@ -208,7 +207,13 @@ func (gc *GarbageCollector) Sync(discoveryClient discovery.DiscoveryInterface, p
...
@@ -208,7 +207,13 @@ func (gc *GarbageCollector) Sync(discoveryClient discovery.DiscoveryInterface, p
}
}
if
!
controller
.
WaitForCacheSync
(
"garbage collector"
,
stopCh
,
gc
.
dependencyGraphBuilder
.
IsSynced
)
{
if
!
controller
.
WaitForCacheSync
(
"garbage collector"
,
stopCh
,
gc
.
dependencyGraphBuilder
.
IsSynced
)
{
utilruntime
.
HandleError
(
fmt
.
Errorf
(
"timed out waiting for dependency graph builder sync during GC sync"
))
utilruntime
.
HandleError
(
fmt
.
Errorf
(
"timed out waiting for dependency graph builder sync during GC sync"
))
return
}
}
// Finally, keep track of our new state. Do this after all preceding steps
// have succeeded to ensure we'll retry on subsequent syncs if an error
// occured.
oldResources
=
newResources
},
period
,
stopCh
)
},
period
,
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