Skip to content

Commit

Permalink
Use pkg/reuseport when listening.
Browse files Browse the repository at this point in the history
(It does not compile yet
Waiting for coredns#3455
to add go.mod/sum changes)

Signed-off-by: Gonzalo Paniagua Javier <gonzalo.mono@gmail.com>
  • Loading branch information
gonzalop committed Nov 17, 2019
1 parent 919de69 commit f709f6e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugin/pprof/pprof.go
Expand Up @@ -3,11 +3,12 @@
package pprof

import (
reuse "github.com/libp2p/go-reuseport"
"net"
"net/http"
pp "net/http/pprof"
"runtime"

"github.com/coredns/coredns/plugin/pkg/reuseport"
)

type handler struct {
Expand All @@ -21,7 +22,7 @@ func (h *handler) Startup() error {
// Reloading the plugin without changing the listening address results
// in an error unless we reuse the port because Startup is called for
// new handlers before Shutdown is called for the old ones.
ln, err := reuse.Listen("tcp", h.addr)
ln, err := reuseport.Listen("tcp", h.addr)
if err != nil {
log.Errorf("Failed to start pprof handler: %s", err)
return err
Expand Down

0 comments on commit f709f6e

Please sign in to comment.