Skip to content

Commit

Permalink
Merge branch 'master' into remove-lic
Browse files Browse the repository at this point in the history
  • Loading branch information
clyang82 authored Mar 30, 2020
2 parents 9d1e200 + a42eb32 commit 04b5700
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
12 changes: 10 additions & 2 deletions pkg/ingress/controller/process/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ func WaitUntilPortIsAvailable(port int) {
if err != nil {
break
}
conn.Close()

if err := conn.Close(); err != nil {
glog.Errorf("failed to colse connection: %v", err)
}

// kill nginx worker processes
fs, err := proc.NewFS("/proc")
if err != nil {
Expand All @@ -76,7 +80,11 @@ func WaitUntilPortIsAvailable(port int) {
glog.Errorf("unexpected error obtaining process information: %v", err)
continue
}
osp.Signal(syscall.SIGQUIT)

if err := osp.Signal(syscall.SIGQUIT); err != nil {
glog.Errorf("failed to send signal: %v", err)
}

}
}
time.Sleep(100 * time.Millisecond)
Expand Down
7 changes: 6 additions & 1 deletion pkg/net/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
"fmt"
_net "net"
"os/exec"

"github.com/golang/glog"
)

// IsIPV6 checks if the input contains a valid IPV6 address
Expand All @@ -33,7 +35,10 @@ func IsPortAvailable(p int) bool {
if err != nil {
return false
}
ln.Close()

if err := ln.Close(); err != nil {
glog.Errorf("failed to colse listener: %v", err)
}
return true
}

Expand Down

0 comments on commit 04b5700

Please sign in to comment.