@@ -207,9 +207,12 @@ func (ctrl *csiSnapshotCommonController) snapshotWorker() {
207
207
newSnapshot , err := ctrl .checkAndUpdateSnapshotClass (snapshot )
208
208
if err == nil {
209
209
klog .V (5 ).Infof ("passed checkAndUpdateSnapshotClass for snapshot %q" , key )
210
- ctrl .updateSnapshot (newSnapshot )
210
+ err = ctrl .updateSnapshot (newSnapshot )
211
+ }
212
+ if err != nil {
213
+ ctrl .snapshotQueue .AddRateLimited (key )
214
+ return false
211
215
}
212
- return false
213
216
}
214
217
if err != nil && ! errors .IsNotFound (err ) {
215
218
klog .V (2 ).Infof ("error getting snapshot %q from informer: %v" , key , err )
@@ -340,7 +343,7 @@ func (ctrl *csiSnapshotCommonController) checkAndUpdateSnapshotClass(snapshot *c
340
343
341
344
// updateSnapshot runs in worker thread and handles "snapshot added",
342
345
// "snapshot updated" and "periodic sync" events.
343
- func (ctrl * csiSnapshotCommonController ) updateSnapshot (snapshot * crdv1.VolumeSnapshot ) {
346
+ func (ctrl * csiSnapshotCommonController ) updateSnapshot (snapshot * crdv1.VolumeSnapshot ) error {
344
347
// Store the new snapshot version in the cache and do not process it if this is
345
348
// an old version.
346
349
klog .V (5 ).Infof ("updateSnapshot %q" , utils .SnapshotKey (snapshot ))
@@ -349,7 +352,7 @@ func (ctrl *csiSnapshotCommonController) updateSnapshot(snapshot *crdv1.VolumeSn
349
352
klog .Errorf ("%v" , err )
350
353
}
351
354
if ! newSnapshot {
352
- return
355
+ return nil
353
356
}
354
357
err = ctrl .syncSnapshot (snapshot )
355
358
if err != nil {
@@ -359,8 +362,10 @@ func (ctrl *csiSnapshotCommonController) updateSnapshot(snapshot *crdv1.VolumeSn
359
362
klog .V (3 ).Infof ("could not sync claim %q: %+v" , utils .SnapshotKey (snapshot ), err )
360
363
} else {
361
364
klog .Errorf ("could not sync volume %q: %+v" , utils .SnapshotKey (snapshot ), err )
365
+ return err
362
366
}
363
367
}
368
+ return nil
364
369
}
365
370
366
371
// updateContent runs in worker thread and handles "content added",
0 commit comments