Skip to content

Commit

Permalink
fix: fix the false alarm while stopping syncing backup status
Browse files Browse the repository at this point in the history
Use warning-level messages for context canceled.

Longhorn 10301

Signed-off-by: Derek Su <derek.su@suse.com>
  • Loading branch information
derekbit committed Feb 18, 2025
1 parent 391a314 commit 457c62b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion engineapi/backup_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"sync"
"time"

"github.com/pkg/errors"
"github.com/sirupsen/logrus"

"k8s.io/apimachinery/pkg/util/wait"
Expand Down Expand Up @@ -209,7 +210,11 @@ func (m *BackupMonitor) linerTimer() {
m.syncCallBack(currentBackupStatus)
return false, nil
}); err != nil {
m.logger.WithError(err).Error("Failed to sync backup status")
if errors.Is(err, context.Canceled) {
m.logger.WithError(err).Warn("Sync backup status canceled")
} else {
m.logger.WithError(err).Error("Failed to sync backup status")
}
}
}

Expand Down

0 comments on commit 457c62b

Please sign in to comment.