Skip to content

Commit

Permalink
add debug comments
Browse files Browse the repository at this point in the history
  • Loading branch information
adikul30 committed Sep 25, 2024
1 parent 95d5544 commit 6b476b1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/common/cns-lib/volume/listview.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ func (l *ListViewImpl) ResetVirtualCenter(ctx context.Context, virtualCenter *cn
log.Info("cancelling ongoing listView context to trigger restart with new credentials")
if l.waitForUpdatesCancelFunc != nil {
l.waitForUpdatesCancelFunc()
log.Info("called waitForUpdatesCancelFunc")
log.Infof("waitForUpdatesContext %+v", l.waitForUpdatesContext)
}
log.Info("updated VirtualCenter object reference in ListView")
}
Expand Down Expand Up @@ -187,6 +189,8 @@ func (l *ListViewImpl) AddTask(ctx context.Context, taskMoRef types.ManagedObjec
log.Infof("cancelling ongoing listView context to re-create listview object")
if l.waitForUpdatesCancelFunc != nil {
l.waitForUpdatesCancelFunc()
log.Info("called waitForUpdatesCancelFunc")
log.Infof("waitForUpdatesContext %+v", l.waitForUpdatesContext)
}
return fmt.Errorf("%w. task: %v, err: %v", ErrListViewTaskAddition, taskMoRef, err)
}
Expand Down Expand Up @@ -240,6 +244,8 @@ func (l *ListViewImpl) RemoveTask(ctx context.Context, taskMoRef types.ManagedOb
log.Infof("cancelling ongoing listView context to re-create listview object")
if l.waitForUpdatesCancelFunc != nil {
l.waitForUpdatesCancelFunc()
log.Info("called waitForUpdatesCancelFunc")
log.Infof("waitForUpdatesContext %+v", l.waitForUpdatesContext)
}
return logger.LogNewErrorf(log, "failed to remove task %v from ListView. error: %+v", taskMoRef, err)
}
Expand Down Expand Up @@ -285,6 +291,7 @@ func (l *ListViewImpl) listenToTaskUpdates() {
}

log.Info("Starting listening for task updates...")
log.Infof("waitForUpdatesContext %v", l.waitForUpdatesContext)
pc := property.DefaultCollector(l.virtualCenter.Client.Client)
err := property.WaitForUpdatesEx(l.waitForUpdatesContext, pc, filter, func(updates []types.ObjectUpdate) bool {
log.Debugf("Got %d property collector update(s)", len(updates))
Expand Down

0 comments on commit 6b476b1

Please sign in to comment.