Skip to content

Map EINPROGRESS to io::ErrorKind::WouldBlock #101155

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

Closed
wants to merge 3 commits into from

Conversation

aviramha
Copy link
Contributor

No description provided.

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Aug 29, 2022
@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @thomcc (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 29, 2022
@thomcc thomcc added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 29, 2022
Copy link
Member

@thomcc thomcc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please read the about adding new functionality to the stdlib: https://std-dev-guide.rust-lang.org/feature-lifecycle/summary.html. In particular, this needs an API change proposal, as described here: https://std-dev-guide.rust-lang.org/feature-lifecycle/api-change-proposals.html

However, this seems redundant with ErrorKind::WouldBlock, so you'll need to explain how this is different and worth adding.

@@ -341,6 +341,10 @@ pub enum ErrorKind {
#[stable(feature = "unsupported_error", since = "1.53.0")]
Unsupported,

/// The operation was partially sucessful and needs to be checked
/// later on due to not blocking
InProgress,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need an unstable annotation. Something like #[unstable(feature = "io_error_inprogress", issue = "none")]

@thomcc
Copy link
Member

thomcc commented Aug 29, 2022

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 29, 2022
@rust-log-analyzer

This comment has been minimized.

@aviramha
Copy link
Contributor Author

Please read the about adding new functionality to the stdlib: https://std-dev-guide.rust-lang.org/feature-lifecycle/summary.html. In particular, this needs an API change proposal, as described here: https://std-dev-guide.rust-lang.org/feature-lifecycle/api-change-proposals.html

However, this seems redundant with ErrorKind::WouldBlock, so you'll need to explain how this is different and worth adding.

Thanks for the review, followed your lead and opened an issue - rust-lang/libs-team#92. Let's discuss there?

@rustbot
Copy link
Collaborator

rustbot commented Sep 17, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@aviramha aviramha requested a review from thomcc September 20, 2022 12:24
@aviramha
Copy link
Contributor Author

@rustbot label -S-waiting-on-author +S-waiting-on-review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 20, 2022
@thomcc thomcc added the S-waiting-on-ACP Status: PR has an ACP and is waiting for the ACP to complete. label Sep 20, 2022
@scottmcm scottmcm removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 4, 2023
@Dylan-DPC Dylan-DPC added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-ACP Status: PR has an ACP and is waiting for the ACP to complete. labels Jul 25, 2023
@thomcc thomcc changed the title add InProgress ErrorKind to io::ErrorKind Map EINPROGRESS to io::ErrorKind::WouldBlock Jul 25, 2023
@thomcc
Copy link
Member

thomcc commented Jul 25, 2023

The updated PR looks fine to me, although I'm unsure if this needs API approval. I've nominated it to sort that out.

@thomcc thomcc added the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Jul 25, 2023
@joshtriplett
Copy link
Member

EINPROGRESS is emphatically not WouldBlock. WouldBlock is EAGAIN, which implies that the operation would have blocked but you asked for non-blocking. Thus, various crates react to WouldBlock the way they would for EAGAIN. Those crates should not react to EINPROGRESS the same way.

@thomcc
Copy link
Member

thomcc commented Aug 1, 2023

Do you think we should add an io::ErrorKind::InProgress error, as the original suggestion had? (I have no opinion on this error)

@joshtriplett
Copy link
Member

Yes, I think we should.

@m-ou-se
Copy link
Member

m-ou-se commented Aug 15, 2023

Closing this while we figure out what we want here: rust-lang/libs-team#92 :)

@m-ou-se m-ou-se closed this Aug 15, 2023
@m-ou-se m-ou-se removed the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants