You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func New() (*NetlinkReader, error) {
conn, err := newConnection()
if err != nil {
return nil, fmt.Errorf("failed to create a new connection: %s", err)
}
id, err := getFamilyID(conn)
if err != nil {
// if this err happend, conn should be closed
return nil, fmt.Errorf("failed to get netlink family id for task stats: %s", err)
}
klog.V(4).Infof("Family id for taskstats: %d", id)
return &NetlinkReader{
familyID: id,
conn: conn,
}, nil
}
conn should be closed when getFamilyID return error, because socket already been created, if not close, this socket will keep in memory, let process holds a lot of fds.
The text was updated successfully, but these errors were encountered:
code at this line https://github.com/google/cadvisor/blob/v0.44.1/utils/cpuload/netlink/reader.go#L38
conn
should be closed whengetFamilyID
return error, because socket already been created, if not close, this socket will keep in memory, let process holds a lot of fds.The text was updated successfully, but these errors were encountered: