Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upPoll::poll(): Retry select() on EINTR #742
Conversation
This comment has been minimized.
This comment has been minimized.
|
Thanks. I believe that the timeout would need to be updated before |
This comment has been minimized.
This comment has been minimized.
|
Sorry for the slow response. Yes, you're right. |
asayers
force-pushed the
asayers:eintr_retry
branch
from
eba91ff
to
b1a9eec
Oct 11, 2017
This comment has been minimized.
This comment has been minimized.
|
A CI fix has been merged to master. Would you mind rebasing when you have a moment? Thanks! |
asayers
force-pushed the
asayers:eintr_retry
branch
from
b1a9eec
to
0b4ca9b
Oct 11, 2017
This comment has been minimized.
This comment has been minimized.
|
Rebased. The iOS CI run timed out after starting the test program. I can't tell if this failure is genuine - is it possible to rerun the test? |
This comment has been minimized.
This comment has been minimized.
|
It probably is spurious. iOS CI is really janky. |
asayers
force-pushed the
asayers:eintr_retry
branch
from
0b4ca9b
to
3c1882d
Oct 17, 2017
This comment has been minimized.
This comment has been minimized.
|
Added a line to the changelog. |
carllerche
reviewed
Oct 25, 2017
| if let Some(to) = timeout { | ||
| let elapsed = now.elapsed(); | ||
| timeout = if elapsed >= to { | ||
| Some(Duration::from_millis(0)) |
This comment has been minimized.
This comment has been minimized.
carllerche
Oct 25, 2017
Owner
At this point, would you not break? While probably an implausible situation, if each call to select returns w/ an interrupt, this would cause an infinite loop?
This comment has been minimized.
This comment has been minimized.
asayers
Oct 30, 2017
•
Author
Contributor
I assumed that calling select with a timeout of 0 is non-blocking and therefore can't return EINTR, but to my surprise a bit of googling revealed that "non-blocking syscalls don't return EINTR" is not actually documented behaviour. I'll change to a break.
EDIT: I found an email from David Miller saying that EINTR is impossible for non-blocking syscalls on Linux and (he thinks) on BSD.
asayers
force-pushed the
asayers:eintr_retry
branch
from
3c1882d
to
fe4430d
Oct 30, 2017
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
|
Thanks for hanging in there. |
carllerche
merged commit 548ed6a
into
carllerche:master
Nov 7, 2017
This comment has been minimized.
This comment has been minimized.
|
Thanks! |
This comment has been minimized.
This comment has been minimized.
bbshelper
commented
Jan 11, 2018
|
My application is required to gracefully shutdown itself upon |
This comment has been minimized.
This comment has been minimized.
|
Yeah, it would be fine to add a |
asayers commentedOct 5, 2017
Usually the user should retry poll() on EINTR; however, this is an
easily-overlooked case. Let's improve the reliability of mio-based
programs by handing EINTR by default.
Closes #494.