-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[macOS] Lag when piping stdout #1523
Comments
I have tried to reproduce your result but so far without meaningful success. Nothing on the scale presented by your result. My results seem to vary by server response time.
I have tried with fully up to date Fedora Workstation 38, httpie 3.2.2-2, time 1.9-20, both from Fedora repositories. Could you please double-check that the issue still exists and provide some more details to your setup, like your OS (and version), httpie version and more details what your server response looks like (valid json?, response length? etc). |
Thanks for looking into it. I tested it again against an httpbin server running on localhost and hitting
So it manifests on macOS only; I'll edit the title. |
Thanks for taking the time to double-check. Unfortunately, not having an access to Mac I won't be able to test and look into it further. On the other hand, at the very least, you've managed to narrow the problem down a bit and save the next person looking some time figuring out where the problem is 😄 |
After several hours of debugging, it turns out this is unrelated to potential buffering differences between MacOS and Linux as I had original suspected; it's this code. Commenting it out (or just the That's as far as I got. I don't have an explanation of why this affects only the piped version; the interactive non-piped version also calls I have to say, I am kind of shocked to find out that an HTTP client CLI includes a "feature" that:
IMO the whole |
Wow, that's some wonderful investigation you've done. Yes, it I can reproduce the behavior on Linux if I switch the code to the subprocess behavior used on MacOS. I'm no expert in the low level OS details either, but should I guess (based on some investigations), the difference seems to be that the Come to think of it, I really don't know why the The only thing I can see it does is wait for the subprocess to finish (which seems to be against the purpose of daemonizing the update fetcher). But feel free to correct me if I am wrong - @isidentical and @jkbrzt (authors of the commit). Unless you see a use for it, I would suggest just to remove the |
- remove process.communicate() in MacOS causing wait for subprocess even when the subprocess results were not used.
- remove process.communicate() in MacOS causing wait for subprocess even when the subprocess results were not used.
When redirecting httpie output to a pipe, there is a significant lag in the total execution time:
Note that the lag appears to be happening in the
cat
command afterhttpie
, which doesn't make sense and doesn't happen forcurl
orwget
:Checklist
The text was updated successfully, but these errors were encountered: