8000 Fix random errors for piped input on macos by Joining7943 · Pull Request #3953 · uutils/coreutils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix random errors for piped input on macos #3953

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

Merged
merged 1 commit into from
Sep 21, 2022

Conversation

Joining7943
Copy link
Contributor
@Joining7943 Joining7943 commented Sep 18, 2022

Fix the random errors around piped input, mainly on macos but in theory also possible on other unix systems. When we canonicalize a path to find out if we can treat input from Stdin as fifo (we get a resulting path here) or pipe, (we don't) then it may happen sometimes that the canonicalized path points to /dev/fd/0. We should treat this result like a pipe.

A different solution also may have been to remove the guards from the is_tailable() method, but I've found putting the solution into the resolve() method being more explicit. The is_tailable() method should be refactored anyways also because of @niyaznigmatullin comment here #3919 (comment)

Fixes #3958, #3916

@niyaznigmatullin
Copy link
Contributor

I hope you've seen my thoughts on the errors: #3895 (comment)

@Joining7943
Copy link
Contributor Author
Joining7943 commented Sep 19, 2022

Thanks for pointing this out. I haven't seen your comment. But you may have noticed that the code for tail changed quiet a bit since #3905. I'm in the process of writing an explanation for this fix. It addresses another kind of error than the one you've figured out in #3895. I've removed ignore_stdin_write_error() from the pipe tests, to see if the CI is still failing and it isn't. Let's see how long it lasts and what happens. We can easily revert the deletion of ignore_stdin_write_error() as soon as the random errors around 0 input 0 output reappear.

@Joining7943 Joining7943 force-pushed the fix-random-errors-on-macos branch 2 times, most recently from 179ae46 to 96321f9 Compare September 20, 2022 01:17
@Joining7943 Joining7943 marked this pull request as ready for review September 20, 2022 17:59
@niyaznigmatullin
Copy link
Contributor
niyaznigmatullin commented Sep 20, 2022

I suggest you to try to test locally with timeout between spawning child process and writing to stdin, to see when ignoring is for sure required.

@Joining7943
Copy link
Contributor Author

@niyaznigmatullin The broken pipe errors don't have anything to do with this fix. Can you please stay out :)

@niyaznigmatullin
Copy link
Contributor

Sorry for that. I didn't try to say it's about the change. The suggestion was as an alternative to:

We can easily revert the deletion of ignore_stdin_write_error() as soon as the random errors around 0 input 0 output reappear.

@Joining7943
Copy link
Contributor Author

No, this is a different kind of beast.

@sylvestre
Copy link
Contributor

let's try to see if it improves the situation

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.

test_pipe_when_bytes_option_given_input_size_has_multiple_size_of_buffer_size is failing intermittently on mac
3 participants
0