Skip to content

Commit b6f49d0

Browse files
committed
Add retries to conntracker.ClearEntries()
Signed-off-by: Daman Arora <[email protected]>
1 parent 90a42e0 commit b6f49d0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkg/proxy/conntrack/conntrack.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,15 @@ func (ct *conntracker) ClearEntries(ipFamily uint8, filters ...netlink.CustomCon
7575
return 0, nil
7676
}
7777

78-
n, err := ct.handler.ConntrackDeleteFilters(netlink.ConntrackTable, netlink.InetFamily(ipFamily), filters...)
78+
var n uint
79+
var err error
80+
err = retry.OnError(util.MaxAttemptsEINTR, util.ShouldRetryOnEINTR, func() error {
81+
var count uint
82+
count, err = ct.handler.ConntrackDeleteFilters(netlink.ConntrackTable, netlink.InetFamily(ipFamily), filters...)
83+
n += count
84+
return err
85+
})
86+
7987
if err != nil {
8088
return int(n), fmt.Errorf("error deleting conntrack entries, error: %w", err)
8189
}

0 commit comments

Comments
 (0)