Skip to content

fix stuck poll() when interface down#987

Open
msaare123 wants to merge 1 commit into
luigirizzo:masterfrom
msaare123:fix_stuck_poll_when_interface_down
Open

fix stuck poll() when interface down#987
msaare123 wants to merge 1 commit into
luigirizzo:masterfrom
msaare123:fix_stuck_poll_when_interface_down

Conversation

@msaare123

Copy link
Copy Markdown
Contributor

In linux when any of the polled interfaces is brought down (NETDEV_GOING_DOWN) rings were previously set to NM_KR_LOCKED state. That caused nm_kr_tryget() to get stuck in retry loop inside poll() until interface was eventually brought up again.

In this patch the issue was fixed by setting ring state to NM_KR_STOPPED instead of NM_KR_LOCKED. After the fix poll() will return POLLERR for interface that is brought down which in my mind is the correct operation.

In linux when any of the polled interfaces is brought down (NETDEV_GOING_DOWN)
rings were previosly set to NM_KR_LOCKED state. That caused nm_kr_tryget() to get
stuck in retry loop inside poll() until interface was eventually brought up again.

In this patch the issue was fixed by setting ring state to NM_KR_STOPPED instead of NM_KR_LOCKED.
After the fix poll() will return POLLERR for interface that is brought down which in my mind
is the correct operation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant