Skip to content

Commit

Permalink
Don't log error if watch cancel can't be sent because the connection …
Browse files Browse the repository at this point in the history
…was closed

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
  • Loading branch information
brandond committed Oct 30, 2023
1 parent f2d9e5d commit 7fae548
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/server/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/sirupsen/logrus"
"go.etcd.io/etcd/api/v3/etcdserverpb"
"go.etcd.io/etcd/api/v3/mvccpb"
clientv3 "go.etcd.io/etcd/client/v3"
)

var watchID int64
Expand Down Expand Up @@ -138,7 +139,7 @@ func (w *watcher) Cancel(watchID int64, err error) {
CancelReason: "watch closed",
WatchId: watchID,
})
if serr != nil && err != nil {
if serr != nil && err != nil && !clientv3.IsConnCanceled(serr) {
logrus.Errorf("WATCH Failed to send cancel response for watchID %d: %v", watchID, serr)
}
}
Expand Down

0 comments on commit 7fae548

Please sign in to comment.