Skip to content

Commit b3350b5

Browse files
authored
fix: Add iptables execution timeout (#11176)
1 parent cd4e037 commit b3350b5

File tree

1 file changed

+2
-2
lines changed
  • agent/utils/firewall/client/iptables

1 file changed

+2
-2
lines changed

‎agent/utils/firewall/client/iptables/common.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const (
4444
)
4545

4646
funcRunWithStd(tab, rulestring) (string, error){
47-
cmdMgr:=cmd.NewCommandMgr(cmd.WithIgnoreExist1(), cmd.WithTimeout(20*time.Second))
47+
cmdMgr:=cmd.NewCommandMgr(cmd.WithIgnoreExist1(), cmd.WithTimeout(60*time.Second))
4848
stdout, err:=cmdMgr.RunWithStdoutBashCf("%s iptables -w -t %s %s", cmd.SudoHandleCmd(), tab, rule)
4949
iferr!=nil{
5050
global.LOG.Errorf("iptables command failed [table=%s, rule=%s]: %v", tab, rule, err)
@@ -53,7 +53,7 @@ func RunWithStd(tab, rule string) (string, error){
5353
returnstdout, nil
5454
}
5555
funcRunWithoutIgnore(tab, rulestring) (string, error){
56-
cmdMgr:=cmd.NewCommandMgr(cmd.WithTimeout(20*time.Second))
56+
cmdMgr:=cmd.NewCommandMgr(cmd.WithTimeout(60*time.Second))
5757
stdout, err:=cmdMgr.RunWithStdoutBashCf("%s iptables -t %s %s", cmd.SudoHandleCmd(), tab, rule)
5858
iferr!=nil{
5959
returnstdout, err

0 commit comments

Comments
(0)