Skip to content

Commit

Permalink
Merge pull request kubernetes#6418 from jdef/fix_6416
Browse files Browse the repository at this point in the history
fixes data race in node controller
  • Loading branch information
yujuhong committed Apr 3, 2015
2 parents 98bf5ae + 4d3a9e2 commit 3d1dfd4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/cloudprovider/controller/nodecontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (nc *NodeController) Run(period time.Duration, syncNodeList, syncNodeStatus
// Start syncing node list from cloudprovider.
if syncNodeList && nc.isRunningCloudProvider() {
go util.Forever(func() {
if err = nc.SyncCloudNodes(); err != nil {
if err := nc.SyncCloudNodes(); err != nil {
glog.Errorf("Error syncing cloud: %v", err)
}
}, period)
Expand All @@ -170,13 +170,13 @@ func (nc *NodeController) Run(period time.Duration, syncNodeList, syncNodeStatus
// Start syncing or monitoring node status.
if syncNodeStatus {
go util.Forever(func() {
if err = nc.SyncProbedNodeStatus(); err != nil {
if err := nc.SyncProbedNodeStatus(); err != nil {
glog.Errorf("Error syncing status: %v", err)
}
}, period)
} else {
go util.Forever(func() {
if err = nc.MonitorNodeStatus(); err != nil {
if err := nc.MonitorNodeStatus(); err != nil {
glog.Errorf("Error monitoring node status: %v", err)
}
}, nodeMonitorPeriod)
Expand Down

0 comments on commit 3d1dfd4

Please sign in to comment.