fdtrack: temporary hack for tracking file descriptor usage
Package fdtrack logs statistics about open file descriptors. This should help identify the source of #1549.
This commit is contained in:
@ -25,6 +25,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/fdtrack"
|
||||
"github.com/ethereum/go-ethereum/logger"
|
||||
"github.com/ethereum/go-ethereum/logger/glog"
|
||||
"github.com/ethereum/go-ethereum/p2p/nat"
|
||||
@ -197,6 +198,7 @@ func ListenUDP(priv *ecdsa.PrivateKey, laddr string, natm nat.Interface, nodeDBP
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fdtrack.Open("p2p")
|
||||
conn, err := net.ListenUDP("udp", addr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -234,6 +236,7 @@ func newUDP(priv *ecdsa.PrivateKey, c conn, natm nat.Interface, nodeDBPath strin
|
||||
|
||||
func (t *udp) close() {
|
||||
close(t.closing)
|
||||
fdtrack.Close("p2p")
|
||||
t.conn.Close()
|
||||
// TODO: wait for the loops to end.
|
||||
}
|
||||
|
Reference in New Issue
Block a user