Merge pull request #6418 from jdef/fix_6416
fixes data race in node controller
This commit is contained in:
@@ -161,7 +161,7 @@ func (nc *NodeController) Run(period time.Duration, syncNodeList, syncNodeStatus
|
|||||||
// Start syncing node list from cloudprovider.
|
// Start syncing node list from cloudprovider.
|
||||||
if syncNodeList && nc.isRunningCloudProvider() {
|
if syncNodeList && nc.isRunningCloudProvider() {
|
||||||
go util.Forever(func() {
|
go util.Forever(func() {
|
||||||
if err = nc.SyncCloudNodes(); err != nil {
|
if err := nc.SyncCloudNodes(); err != nil {
|
||||||
glog.Errorf("Error syncing cloud: %v", err)
|
glog.Errorf("Error syncing cloud: %v", err)
|
||||||
}
|
}
|
||||||
}, period)
|
}, period)
|
||||||
@@ -170,13 +170,13 @@ func (nc *NodeController) Run(period time.Duration, syncNodeList, syncNodeStatus
|
|||||||
// Start syncing or monitoring node status.
|
// Start syncing or monitoring node status.
|
||||||
if syncNodeStatus {
|
if syncNodeStatus {
|
||||||
go util.Forever(func() {
|
go util.Forever(func() {
|
||||||
if err = nc.SyncProbedNodeStatus(); err != nil {
|
if err := nc.SyncProbedNodeStatus(); err != nil {
|
||||||
glog.Errorf("Error syncing status: %v", err)
|
glog.Errorf("Error syncing status: %v", err)
|
||||||
}
|
}
|
||||||
}, period)
|
}, period)
|
||||||
} else {
|
} else {
|
||||||
go util.Forever(func() {
|
go util.Forever(func() {
|
||||||
if err = nc.MonitorNodeStatus(); err != nil {
|
if err := nc.MonitorNodeStatus(); err != nil {
|
||||||
glog.Errorf("Error monitoring node status: %v", err)
|
glog.Errorf("Error monitoring node status: %v", err)
|
||||||
}
|
}
|
||||||
}, nodeMonitorPeriod)
|
}, nodeMonitorPeriod)
|
||||||
|
Reference in New Issue
Block a user