eni/watcher: skip logging eni status sent error.
@@ -18,6 +18,7 @@ package watcher
import (
"context"
"fmt"
+ "strings"
"time"
log "github.com/cihub/seelog"
@@ -73,6 +74,10 @@ const (
// for the host to learn about an ENIs mac address from netlink.LinkList().
// We are capping off this duration to 1s assuming worst-case behavior
macAddressRetryTimeout = 2 * time.Second
+
+ // eniStatusSentMsg is the error message to use when trying to send an eni status that's
+ // already been sent
+ eniStatusSentMsg = "eni status already sent"
)
// UdevWatcher maintains the state of attached ENIs
@@ -184,6 +189,11 @@ func (udevWatcher *UdevWatcher) reconcileOnce() error {
// Add new interfaces next
for mac := range currentState {
if err := udevWatcher.sendENIStateChange(mac); err != nil {
+ // skip logging status sent error as it's redundant and doesn't really indicate a problem
+ if strings.Contains(err.Error(), eniStatusSentMsg) {
+ continue
+ }
+
log.Warnf("Udev watcher reconciliation: unable to send state change: %v", err)
}
}
@@ -201,7 +211,7 @@ func (udevWatcher *UdevWatcher) sendENIStateChange(mac string) error {
return &unmanagedENIError{mac}
}
if eni.IsSent() {
- return errors.Errorf("udev watcher send ENI state change: eni status already sent: %s", eni.String())
+ return errors.Errorf("udev watcher send ENI state change: %s: %s", eniStatusSentMsg, eni.String())
}
if eni.HasExpired() {
// Agent is aware of the ENI, but we decide not to ack it
