-
Notifications
You must be signed in to change notification settings - Fork 124
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
Retry poll on EINTR/EAGAIN instead of debug printing #215
Conversation
Thank you very much for spotting this and your PR @ThomasHabets! Were you running into this issue regularly? Are you able to reproduce this in a "clean room" environment at best (for deriving a regression test)? |
The dbg usage was accidentally checked in with 5043ce7.
The docs for the implemetation of Sub for Instant state that the operation currently saturates but future versions may reintroduce panics.
Just a little nitpick: The documentation of the implementation of |
I found that the tests were not just a matter of running |
Good point about the Sub. I did not know that. |
After sleeping over it, i would not retry reading on I'm still undecided on I'm with you, that serialport-rs should not generate any output to stdout or stderr. So I've set up #216 to clean my leftovers from a previous commit quickly and independently of our discussion here. May be the latter is already everything need to solve your actual issue for you. |
You may be right. The complete solution may be to just remove the debug print. Rust seems to document using glibc provides IIRC the actual behaviour is actually specific to which Unix you're using. E.g. it used to be the case that if you ran It's been a long time since I looked at this, but the application could also be running with That is to say that you can't rely on EINTR ever happening. AFAIK it's perfectly POSIX OK for the OS to just continue the syscall. So I guess just make sure |
This fix #216 is released trough #217 as 4.5.1 just now. Thank you @eldruin for your swift review!
And it looks like we are doing exactly that in
Thanks for the reference! I did not know this macro. Do you know if there is a similar adapter available in the rust ecosystem?
Looks like we're already there with respect to the error propagation. And with removed debug output released, there is nothing left to here. Thank you for the fruitful discussion! Please feel free to reopen the issue if i missed something @ThomasHabets. |
Thanks, this is a good pointer too. I will keep this in mind and if users start to run into |
@sirhcel I don't know if there's anything like Yeah, this all seems good to me. Thanks for fixing. |
EINTR
is a perfectly cromulent return code, and should not trigger any output to stderr. In fact, no error should cause a library to print to stderr, but especially not a syscall abort that's not even an error condition.