Removed snapshotQueue.AddRateLimited
This commit is contained in:
@@ -207,12 +207,9 @@ func (ctrl *csiSnapshotCommonController) snapshotWorker() {
|
|||||||
newSnapshot, err := ctrl.checkAndUpdateSnapshotClass(snapshot)
|
newSnapshot, err := ctrl.checkAndUpdateSnapshotClass(snapshot)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
klog.V(5).Infof("passed checkAndUpdateSnapshotClass for snapshot %q", key)
|
klog.V(5).Infof("passed checkAndUpdateSnapshotClass for snapshot %q", key)
|
||||||
err = ctrl.updateSnapshot(newSnapshot)
|
ctrl.updateSnapshot(newSnapshot)
|
||||||
}
|
|
||||||
if err != nil {
|
|
||||||
ctrl.snapshotQueue.AddRateLimited(key)
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
if err != nil && !errors.IsNotFound(err) {
|
if err != nil && !errors.IsNotFound(err) {
|
||||||
klog.V(2).Infof("error getting snapshot %q from informer: %v", key, err)
|
klog.V(2).Infof("error getting snapshot %q from informer: %v", key, err)
|
||||||
@@ -343,7 +340,7 @@ func (ctrl *csiSnapshotCommonController) checkAndUpdateSnapshotClass(snapshot *c
|
|||||||
|
|
||||||
// updateSnapshot runs in worker thread and handles "snapshot added",
|
// updateSnapshot runs in worker thread and handles "snapshot added",
|
||||||
// "snapshot updated" and "periodic sync" events.
|
// "snapshot updated" and "periodic sync" events.
|
||||||
func (ctrl *csiSnapshotCommonController) updateSnapshot(snapshot *crdv1.VolumeSnapshot) error {
|
func (ctrl *csiSnapshotCommonController) updateSnapshot(snapshot *crdv1.VolumeSnapshot) {
|
||||||
// Store the new snapshot version in the cache and do not process it if this is
|
// Store the new snapshot version in the cache and do not process it if this is
|
||||||
// an old version.
|
// an old version.
|
||||||
klog.V(5).Infof("updateSnapshot %q", utils.SnapshotKey(snapshot))
|
klog.V(5).Infof("updateSnapshot %q", utils.SnapshotKey(snapshot))
|
||||||
@@ -352,7 +349,7 @@ func (ctrl *csiSnapshotCommonController) updateSnapshot(snapshot *crdv1.VolumeSn
|
|||||||
klog.Errorf("%v", err)
|
klog.Errorf("%v", err)
|
||||||
}
|
}
|
||||||
if !newSnapshot {
|
if !newSnapshot {
|
||||||
return nil
|
return
|
||||||
}
|
}
|
||||||
err = ctrl.syncSnapshot(snapshot)
|
err = ctrl.syncSnapshot(snapshot)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -362,10 +359,8 @@ func (ctrl *csiSnapshotCommonController) updateSnapshot(snapshot *crdv1.VolumeSn
|
|||||||
klog.V(3).Infof("could not sync claim %q: %+v", utils.SnapshotKey(snapshot), err)
|
klog.V(3).Infof("could not sync claim %q: %+v", utils.SnapshotKey(snapshot), err)
|
||||||
} else {
|
} else {
|
||||||
klog.Errorf("could not sync volume %q: %+v", utils.SnapshotKey(snapshot), err)
|
klog.Errorf("could not sync volume %q: %+v", utils.SnapshotKey(snapshot), err)
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// updateContent runs in worker thread and handles "content added",
|
// updateContent runs in worker thread and handles "content added",
|
||||||
|
Reference in New Issue
Block a user