-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add InProgress
variant to io::ErrorKind
#92
Comments
I don't think it makes sense for us to reflect all errno values in But, on the one hand, |
I'm fine with that. I am not really synced with the general thought of best practice in this so really up to the maintainers 😊 |
Took @thomcc and changed the PR to use |
Sounds like this got resolved without adding this variant. We may, in the future, want to add such a variant for other purposes, but it sounds like we can close this ACP for now. |
This seems to have gotten closed on the theory that |
We don't have a consensus in @rust-lang/libs-api to create an Leaving this open in the hopes that we reach a consensus to do so. |
Thanks for discussing this. |
Originally we thought it'd make sense to merge this with However, when we try to discuss this in the team meeting, we get stuck on not having a complete overview of how these errors occur and are handled in practice, especially on different platforms. So, to move this forward, we'll need a bit more context to answer questions like: When does this error occur? How does one usually handle this error? Does it exist on non-unix platforms? If so, does it represent the exact same thing? Would adding this |
Thanks @m-ou-se - I will try to provide my findings. When does it occur?It occurs when you call a procedure which can take time to complete, and isn't blocking to completion - in sockets for example when the socket is set to not block, and you call Example from stdlib: How does one usually handle this error?It's considered a non-error, it's a way of letting the caller know that the operation didn't fail but also didn't complete yet. We originally faced it because our code "errored" while getting this while it's not a "true" error. The handling is success - continue. Does it exist on non-unix platforms?It exists on Windows and other POSIX-compliant systems, not sure about other? Would adding this
|
We discussed this once more in today's libs-api meeting, and confirmed that we want this to be a separate The primary intended distinction here (various platform portability issues aside) is that |
Woohoo! Great news. Is it okay if I reopen my PR? |
@aviramha Please do reopen, or make a new one, whichever is simpler for providing a PR that applies. |
add InProgress ErrorKind gated behind io_error_inprogress feature Follow up on rust-lang/libs-team#92 (comment)
Rollup merge of rust-lang#130789 - aviramha:add_inprogress, r=Noratrieb add InProgress ErrorKind gated behind io_error_inprogress feature Follow up on rust-lang/libs-team#92 (comment)
add InProgress ErrorKind gated behind io_error_inprogress feature Follow up on rust-lang/libs-team#92 (comment)
Proposal
Add
InProgress
variant toio::ErrorKind
to support cases where OS error islibc::EINPROGRESS
Problem statement
While working on API that relies on
io::last_os_error
I found out thatkind
field ofio::Error
is set toUncategorized
which means I can't "safely" use.kind()
to check if it's a specific error, in our caselibc::EINPROGRESS
Motivation, use-cases
Our code example that can be simplified given the addition.
Solution sketches
Links and related work
Sent a PR of the proposed change
rust-lang/rust#101155 (review)
The text was updated successfully, but these errors were encountered: