Skip to content

Commit

Permalink
add debug log
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <[email protected]>
  • Loading branch information
lhy1024 committed Aug 17, 2023
1 parent f8ae8e9 commit 200f625
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/utils/etcdutil/etcdutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -711,9 +711,12 @@ func (lw *LoopWatcher) watch(ctx context.Context, revision int64) (nextRevision
case <-ctx.Done():
return revision, nil
case <-ticker.C:
log.Info("request progress in watch loop")
ctx, cancel := context.WithTimeout(ctx, DefaultRequestTimeout)
if err := watcher.RequestProgress(ctx); err != nil {
log.Warn("failed to request progress in watch loop", zap.Error(err))
}
cancel()
if time.Since(lastReceivedResponseTime) >= WatchChTimeoutDuration {
// If no msg comes from an etcd watchChan for WatchChTimeoutDuration long,
// we should cancel the watchChan and request a new watchChan from watcher.
Expand All @@ -727,6 +730,7 @@ func (lw *LoopWatcher) watch(ctx context.Context, revision int64) (nextRevision
}
continue
case wresp := <-watchChan:
log.Info("receive request in watch loop")
lastReceivedResponseTime = time.Now()
if wresp.CompactRevision != 0 {
log.Warn("required revision has been compacted, use the compact revision in watch loop",
Expand Down

0 comments on commit 200f625

Please sign in to comment.