Skip to content
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

Smarter handling of READ_WAIT_TIME and select calls #245

Open
dafyddcrosby opened this issue Jun 11, 2024 · 1 comment
Open

Smarter handling of READ_WAIT_TIME and select calls #245

dafyddcrosby opened this issue Jun 11, 2024 · 1 comment
Labels
Status: Untriaged An issue that has yet to be triaged.

Comments

@dafyddcrosby
Copy link
Contributor

Writing down the discussion had with @tpowell-progress and @jaymzh today

Describe the Enhancement:

The select timeout using READ_WAIT_TIME has high latency for quick shellouts. I made a benchmark script for getting numbers, and on this simple example it would lead one to think READ_WAIT_TIME should be closer to 0.001 instead of 0.01. Syscalls aren't free, though, so that may create new issues on longer-running processes.

Instead, we should adjust the time given to the select calls based on how long a particular shellout is taking via @execution_time, with a sensible ceiling for long-running processes. This gets the best of both worlds for fast shellouts (eg systemctl is-enabled) and long running processes (eg dnf downloading the world), and doesn't require end-users to fool around with the READ_WAIT_TIME constant.

Describe the Need:

Chef Client runs where there's a variety of expected latencies means one-size-fits-all doesn't really exist for timeouts.

Current Alternative

The first alternative is simply clobbering the READ_WAIT_TIME constant, but if there's a variety of calls over the course of the run, this can get ugly fast.

We could make the READ_WAIT_TIME an optional default, but that means that you A) know the option exists, B) have instrumented how long a particular shellout typically takes, and C) that the latency of said shellouts never change.

Can We Help You Implement This?:

I think I can manage this one ;-)

@dafyddcrosby dafyddcrosby added the Status: Untriaged An issue that has yet to be triaged. label Jun 11, 2024
dafyddcrosby added a commit to dafyddcrosby/mixlib-shellout that referenced this issue Jun 19, 2024
This intends to strike a balance between quick and longer-running shellouts

Signed-off-by: David Crosby <[email protected]>
dafyddcrosby added a commit to dafyddcrosby/mixlib-shellout that referenced this issue Nov 12, 2024
This intends to strike a balance between quick and longer-running shellouts

Signed-off-by: David Crosby <[email protected]>
dafyddcrosby added a commit to dafyddcrosby/mixlib-shellout that referenced this issue Nov 12, 2024
This intends to strike a balance between quick and longer-running shellouts

Signed-off-by: David Crosby <[email protected]>
@dafyddcrosby
Copy link
Contributor Author

After discussing #252 today in the community PR review with @tpowell-progress and @dtheyer, will be coming up with an additional benchmark that does functionally the same work with IO#select to see if this might actually be a Ruby issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant