Skip to content

Implement TcpStream::connect_timeout - #43062

Merged
bors merged 1 commit into
rust-lang:masterfrom
sfackler:connect-timeout
Jul 7, 2017
Merged

Implement TcpStream::connect_timeout#43062
bors merged 1 commit into
rust-lang:masterfrom
sfackler:connect-timeout

Conversation

@sfackler

@sfackler sfackler commented Jul 5, 2017

Copy link
Copy Markdown
Member

This breaks the "single syscall rule", but it's really annoying to hand
write and is pretty foundational.

r? @alexcrichton

cc @rust-lang/libs

@sfackler sfackler added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Jul 5, 2017

@alexcrichton alexcrichton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Implementation looks good to me! I'm not too worried about a single-syscall rule here, TcpStream::connect already violates that anyway. This seems fine to me to land as unstable as well, want to open a tracking issue for this?

Also, can you add a test for a zero-duration being an error, as well as a sub-millisecond duration basically not panicking?

Comment thread src/libstd/net/tcp.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you increase this to ~2s just to be super extra sure?

@alexcrichton

Copy link
Copy Markdown
Member

Oh also, I think tidy is failing

@aidanhs aidanhs added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 5, 2017
@sfackler

sfackler commented Jul 6, 2017

Copy link
Copy Markdown
Member Author

@bors r=alexcrichton

@bors

bors commented Jul 6, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit 82efdaa has been approved by alexcrichton

@bors

bors commented Jul 6, 2017

Copy link
Copy Markdown
Collaborator

🔒 Merge conflict

@sfackler

sfackler commented Jul 6, 2017

Copy link
Copy Markdown
Member Author

@bors r=alexcrichton

@bors

bors commented Jul 6, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit b9eb88d has been approved by alexcrichton

@bors

bors commented Jul 6, 2017

Copy link
Copy Markdown
Collaborator

⌛ Testing commit b9eb88d8a0a7158e287f262964492d0c95c038ce with merge 00312896f0a9d560627e63e590d6ff7e7e27a454...

@bors

bors commented Jul 6, 2017

Copy link
Copy Markdown
Collaborator

💔 Test failed - status-appveyor

This breaks the "single syscall rule", but it's really annoying to hand
write and is pretty foundational.
@sfackler

sfackler commented Jul 7, 2017

Copy link
Copy Markdown
Member Author

@bors r=alexcrichton

@bors

bors commented Jul 7, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit 8c92da3 has been approved by alexcrichton

@bors

bors commented Jul 7, 2017

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 8c92da3 with merge 54e3fe7...

bors added a commit that referenced this pull request Jul 7, 2017
Implement TcpStream::connect_timeout

This breaks the "single syscall rule", but it's really annoying to hand
write and is pretty foundational.

r? @alexcrichton

cc @rust-lang/libs
@bors

bors commented Jul 7, 2017

Copy link
Copy Markdown
Collaborator

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 54e3fe7 to master...

@bors
bors merged commit 8c92da3 into rust-lang:master Jul 7, 2017
@setharnold

Copy link
Copy Markdown

Why check the time out for zeros after initiating the connect?

Thanks

@sfackler

sfackler commented Jul 15, 2017 via email

Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

5 participants