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

Issue 10392043: server.go: handle a race between Close and Connect

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by jameinel
Modified:
10 years, 10 months ago
Reviewers:
mp+169999, niemeyer, rog
Visibility:
Public.

Description

server.go: handle a race between Close and Connect If one routine (such as the pinger) starts a new connection at the same time a Close is called (say by test case tear down), it is possible for that connection to return and be marked alive even though all other connections are closed. This checks if closed has happened since the connect was requested, and immediately closes the new connection. See bug #1191487 for more details about how this was triggered in the juju-core test suite. https://code.launchpad.net/~jameinel/mgo/bug-1191487-close-race/+merge/169999 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 10

Patch Set 2 : server.go: handle a race between Close and Connect #

Patch Set 3 : server.go: handle a race between Close and Connect #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -6 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M server.go View 1 2 5 chunks +14 lines, -6 lines 0 comments Download

Messages

Total messages: 7
jameinel
Please take a look.
10 years, 10 months ago (2013-06-18 13:11:23 UTC) #1
jameinel
Please take a look.
10 years, 10 months ago (2013-06-18 13:16:12 UTC) #2
rog
LGTM with a few thoughts and suggestions regarding the test. https://codereview.appspot.com/10392043/diff/1/server.go File server.go (right): https://codereview.appspot.com/10392043/diff/1/server.go#newcode109 ...
10 years, 10 months ago (2013-06-18 13:29:04 UTC) #3
niemeyer
https://codereview.appspot.com/10392043/diff/1/server.go File server.go (right): https://codereview.appspot.com/10392043/diff/1/server.go#newcode109 server.go:109: socket.Close() On 2013/06/18 13:29:04, rog wrote: > server.Unlock() > ...
10 years, 10 months ago (2013-06-18 13:59:07 UTC) #4
jameinel
Please take a look. https://codereview.appspot.com/10392043/diff/1/server_test.go File server_test.go (right): https://codereview.appspot.com/10392043/diff/1/server_test.go#newcode41 server_test.go:41: // It is possible for ...
10 years, 10 months ago (2013-06-18 14:32:25 UTC) #5
niemeyer
LGTM, thanks for the fix.
10 years, 10 months ago (2013-06-18 14:35:23 UTC) #6
niemeyer
10 years, 10 months ago (2013-06-18 14:40:34 UTC) #7
*** Submitted:

Fix race in AcquireSocket

Fix AcquireSocket so it doesn't put sockets in the live list after
the server has been closed. Fix by John Meinel.

R=rog, niemeyer
CC=
https://codereview.appspot.com/10392043
Sign in to reply to this message.

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