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
34d767d4
Unverified
Commit
34d767d4
authored
Jun 25, 2021
by
Brian Downs
Committed by
GitHub
Jun 25, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3510 from briandowns/backport_issue-3414_release_1.21
[Backport 1.21] - fix possible race where bootstrap data might not save
parents
5a67e8dc
3224f6b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
cluster.go
pkg/cluster/cluster.go
+15
-7
No files found.
pkg/cluster/cluster.go
View file @
34d767d4
...
@@ -3,6 +3,7 @@ package cluster
...
@@ -3,6 +3,7 @@ package cluster
import
(
import
(
"context"
"context"
"net/url"
"net/url"
"runtime"
"strings"
"strings"
"github.com/k3s-io/kine/pkg/endpoint"
"github.com/k3s-io/kine/pkg/endpoint"
...
@@ -102,15 +103,22 @@ func (c *Cluster) Start(ctx context.Context) (<-chan struct{}, error) {
...
@@ -102,15 +103,22 @@ func (c *Cluster) Start(ctx context.Context) (<-chan struct{}, error) {
// snapshots will be empty.
// snapshots will be empty.
if
c
.
managedDB
!=
nil
{
if
c
.
managedDB
!=
nil
{
go
func
()
{
go
func
()
{
for
range
ready
{
for
{
if
err
:=
c
.
save
(
ctx
);
err
!=
nil
{
select
{
panic
(
err
)
case
<-
ready
:
if
err
:=
c
.
save
(
ctx
);
err
!=
nil
{
panic
(
err
)
}
if
err
:=
c
.
managedDB
.
StoreSnapshotData
(
ctx
);
err
!=
nil
{
logrus
.
Errorf
(
"Failed to record snapshots for cluster: %v"
,
err
)
}
return
default
:
runtime
.
Gosched
()
}
}
}
}
if
err
:=
c
.
managedDB
.
StoreSnapshotData
(
ctx
);
err
!=
nil
{
logrus
.
Errorf
(
"Failed to record snapshots for cluster: %v"
,
err
)
}
}()
}()
}
}
...
...
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