Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(588)

Issue 7436048: code review 7436048: net: fix accept/connect deadline handling (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 3 months ago by dvyukov
Modified:
12 years, 3 months ago
Reviewers:
CC:
golang-dev, mikio, bradfitz, iant
Visibility:
Public.

Description

net: fix accept/connect deadline handling Ensure that accept/connect respect deadline, even if the operation can be executed w/o blocking. Note this changes external behavior, but it makes it consistent with read/write. Factor out deadline check into pollServer.PrepareRead/Write, in preparation for edge triggered pollServer. Ensure that pollServer.WaitRead/Write are not called concurrently by adding rio/wio locks around connect/accept.

Patch Set 1 #

Patch Set 2 : diff -r 4cdeb75811c7 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 3 : diff -r 4cdeb75811c7 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 4 : diff -r 4cdeb75811c7 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 5 : diff -r 4cdeb75811c7 https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 6

Patch Set 6 : diff -r 231af8ac63aa https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 1

Patch Set 7 : diff -r 6883846dfe42 https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 9

Patch Set 8 : diff -r 84a41a2c376b https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 9 : diff -r 9b733dc85396 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 10 : diff -r 9b733dc85396 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 11 : diff -r 9b733dc85396 https://dvyukov%40google.com@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+101 lines, -25 lines) Patch
M src/pkg/net/fd_unix.go View 1 2 3 4 5 6 7 10 chunks +42 lines, -24 lines 0 comments Download
M src/pkg/net/timeout_test.go View 1 2 3 2 chunks +59 lines, -1 line 0 comments Download

Messages

Total messages: 23
dvyukov
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://dvyukov%40google.com@code.google.com/p/go/
12 years, 3 months ago (2013-03-01 08:49:59 UTC) #1
mikio
https://codereview.appspot.com/7436048/diff/8001/src/pkg/net/fd_unix.go File src/pkg/net/fd_unix.go (right): https://codereview.appspot.com/7436048/diff/8001/src/pkg/net/fd_unix.go#newcode355 src/pkg/net/fd_unix.go:355: return err &OpError{"connect", fd.net, fd.raddr, err} or will fix ...
12 years, 3 months ago (2013-03-01 11:13:09 UTC) #2
dvyukov
https://codereview.appspot.com/7436048/diff/8001/src/pkg/net/fd_unix.go File src/pkg/net/fd_unix.go (right): https://codereview.appspot.com/7436048/diff/8001/src/pkg/net/fd_unix.go#newcode355 src/pkg/net/fd_unix.go:355: return err On 2013/03/01 11:13:09, mikio wrote: > &OpError{"connect", ...
12 years, 3 months ago (2013-03-01 11:55:44 UTC) #3
dvyukov
PTAL Is it the right thing to check deadline before connect/accept?
12 years, 3 months ago (2013-03-01 11:56:16 UTC) #4
dvyukov
https://codereview.appspot.com/7436048/diff/13001/src/pkg/net/fd_unix.go File src/pkg/net/fd_unix.go (right): https://codereview.appspot.com/7436048/diff/13001/src/pkg/net/fd_unix.go#newcode634 src/pkg/net/fd_unix.go:634: defer fd.rio.Unlock() Is it fine? It somewhat limits parallelism. ...
12 years, 3 months ago (2013-03-01 11:58:04 UTC) #5
mikio
> Done. > It was another bug, right? light. sorry, right.
12 years, 3 months ago (2013-03-01 12:09:54 UTC) #6
mikio
On Fri, Mar 1, 2013 at 8:58 PM, <dvyukov@google.com> wrote: > Is it fine? I ...
12 years, 3 months ago (2013-03-01 12:54:47 UTC) #7
dvyukov
On Fri, Mar 1, 2013 at 2:54 PM, Mikio Hara <mikioh.mikioh@gmail.com> wrote: > On Fri, ...
12 years, 3 months ago (2013-03-01 14:34:06 UTC) #8
dvyukov
Hello golang-dev@googlegroups.com, mikioh.mikioh@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 3 months ago (2013-03-02 06:19:56 UTC) #9
dvyukov
On 2013/03/02 06:19:56, dvyukov wrote: > Hello mailto:golang-dev@googlegroups.com, mailto:mikioh.mikioh@gmail.com (cc: > mailto:golang-dev@googlegroups.com), > > Please ...
12 years, 3 months ago (2013-03-02 08:16:33 UTC) #10
mikio
LGTM
12 years, 3 months ago (2013-03-02 08:30:02 UTC) #11
bradfitz
LGTM but others may have opinions https://codereview.appspot.com/7436048/diff/19001/src/pkg/net/fd_unix.go File src/pkg/net/fd_unix.go (right): https://codereview.appspot.com/7436048/diff/19001/src/pkg/net/fd_unix.go#newcode237 src/pkg/net/fd_unix.go:237: func (s *pollServer) ...
12 years, 3 months ago (2013-03-04 17:31:06 UTC) #12
dvyukov
https://codereview.appspot.com/7436048/diff/19001/src/pkg/net/fd_unix.go File src/pkg/net/fd_unix.go (right): https://codereview.appspot.com/7436048/diff/19001/src/pkg/net/fd_unix.go#newcode237 src/pkg/net/fd_unix.go:237: func (s *pollServer) PrepareRead(fd *netFD) error { On 2013/03/04 ...
12 years, 3 months ago (2013-03-04 20:49:40 UTC) #13
dvyukov
On 2013/03/04 17:31:06, bradfitz wrote: > LGTM but others may have opinions Waiting for others ...
12 years, 3 months ago (2013-03-05 08:17:37 UTC) #14
iant
LGTM https://codereview.appspot.com/7436048/diff/19001/src/pkg/net/fd_unix.go File src/pkg/net/fd_unix.go (right): https://codereview.appspot.com/7436048/diff/19001/src/pkg/net/fd_unix.go#newcode448 src/pkg/net/fd_unix.go:448: return 0, &OpError{"read", fd.net, fd.laddr, err} Why do ...
12 years, 3 months ago (2013-03-05 14:25:56 UTC) #15
dvyukov
https://codereview.appspot.com/7436048/diff/19001/src/pkg/net/fd_unix.go File src/pkg/net/fd_unix.go (right): https://codereview.appspot.com/7436048/diff/19001/src/pkg/net/fd_unix.go#newcode448 src/pkg/net/fd_unix.go:448: return 0, &OpError{"read", fd.net, fd.laddr, err} On 2013/03/05 14:25:57, ...
12 years, 3 months ago (2013-03-05 15:17:52 UTC) #16
iant
https://codereview.appspot.com/7436048/diff/19001/src/pkg/net/fd_unix.go File src/pkg/net/fd_unix.go (right): https://codereview.appspot.com/7436048/diff/19001/src/pkg/net/fd_unix.go#newcode464 src/pkg/net/fd_unix.go:464: err = &OpError{"read", fd.net, fd.laddr, err} On 2013/03/05 15:17:52, ...
12 years, 3 months ago (2013-03-05 17:13:05 UTC) #17
mikio
On Wed, Mar 6, 2013 at 2:13 AM, <iant@golang.org> wrote: > Readmsg can be called ...
12 years, 3 months ago (2013-03-05 20:23:59 UTC) #18
dvyukov
On Tue, Mar 5, 2013 at 10:23 PM, Mikio Hara <mikioh.mikioh@gmail.com> wrote: > On Wed, ...
12 years, 3 months ago (2013-03-05 21:05:35 UTC) #19
iant
On Tue, Mar 5, 2013 at 1:05 PM, Dmitry Vyukov <dvyukov@google.com> wrote: > On Tue, ...
12 years, 3 months ago (2013-03-05 21:35:40 UTC) #20
dvyukov
I've already changed it back. On Tue, Mar 5, 2013 at 11:35 PM, Ian Lance ...
12 years, 3 months ago (2013-03-05 21:41:37 UTC) #21
mikio
LGTM > I've already changed it back. >>> Perhaps we need to file a separate ...
12 years, 3 months ago (2013-03-05 22:56:25 UTC) #22
dvyukov
12 years, 3 months ago (2013-03-07 13:04:04 UTC) #23
*** Submitted as https://code.google.com/p/go/source/detail?r=790eddf30d5d ***

net: fix accept/connect deadline handling
Ensure that accept/connect respect deadline,
even if the operation can be executed w/o blocking.
Note this changes external behavior, but it makes
it consistent with read/write.
Factor out deadline check into pollServer.PrepareRead/Write,
in preparation for edge triggered pollServer.
Ensure that pollServer.WaitRead/Write are not called concurrently
by adding rio/wio locks around connect/accept.

R=golang-dev, mikioh.mikioh, bradfitz, iant
CC=golang-dev
https://codereview.appspot.com/7436048
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b