OSDN Git Service

fix pprof port conflict (#1215)
authorDerek <shanhu5739@gmail.com>
Fri, 3 Aug 2018 03:57:52 +0000 (11:57 +0800)
committerPaladz <yzhu101@uottawa.ca>
Fri, 3 Aug 2018 03:57:52 +0000 (11:57 +0800)
* fix pprof port conflict

* fix pprof port conflict again

node/node.go

index 14bd8a0..66e2b3d 100644 (file)
@@ -130,7 +130,9 @@ func NewNode(config *cfg.Config) *Node {
                // Profiling bytomd programs.see (https://blog.golang.org/profiling-go-programs)
                // go tool pprof http://profileHose/debug/pprof/heap
                go func() {
-                       http.ListenAndServe(profileHost, nil)
+                       if err = http.ListenAndServe(profileHost, nil); err != nil {
+                               cmn.Exit(cmn.Fmt("Failed to register tcp profileHost: %v", err))
+                       }
                }()
        }