vishvananda/netlink

high cpu usage after 916f9685fa42fc711f76a7f48d058e2656f7edf6 which changed Subscribe to nonblocking mode

Opened this issue · 1 comments

in the following code snippets

		for {
			msgs, from, err := s.Receive()
			if err != nil {
				if err == syscall.EAGAIN {
					continue
				}
				if cberr != nil {
					cberr(fmt.Errorf("Receive failed: %v",
						err))

if the socket baking s is changed to non blocking mode as the commit 916f968 did, when there is no event in the socket, kernel will always return EAGAIN which cause the goroutine to a busy loop.

Looks like the bad commit was reverted here 1e68b27