Skip to content

Busy loop on IO.select #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
adsr opened this issue Oct 23, 2024 · 0 comments
Open

Busy loop on IO.select #23

adsr opened this issue Oct 23, 2024 · 0 comments

Comments

@adsr
Copy link

adsr commented Oct 23, 2024

Hello, I noticed knife ssh (a Chef tool) sometimes pegs a core. I traced the issue back to this library, which sometimes falls into a busy IO.select loop here (via the parent's loop_forever):

readers, writers, = IO.select(readers, writers, nil, wait)

This happens when the readers and writers arrays are both empty.

Here are the syscalls being executed which clearly shows the issue:

[pid 25954] getpid()                    = 25954
[pid 25954] pselect6(1, [], [], NULL, {tv_sec=0, tv_nsec=0}, NULL) = 0 (Timeout)
[pid 25954] getpid()                    = 25954
[pid 25954] pselect6(1, [], [], NULL, {tv_sec=0, tv_nsec=0}, NULL) = 0 (Timeout)
[pid 25954] getpid()                    = 25954
[pid 25954] pselect6(1, [], [], NULL, {tv_sec=0, tv_nsec=0}, NULL) = 0 (Timeout)

I haven't dug into this enough to recommend a fix. Not sure if Chef is mis-using this library or if it's purely a library bug, but either way it seems the library shouldn't get into this state.

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

No branches or pull requests

1 participant