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

Issue 7338045: code review 7338045: net/rpc: avoid racy use of closing flag. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 4 months ago by rog
Modified:
9 years, 4 months ago
Reviewers:
CC:
r, iant, golang-dev
Visibility:
Public.

Description

net/rpc: avoid racy use of closing flag. It's accessed without mutex protection in a different goroutine from the one that sets it. Also make sure that Client.Call after Client.Close will reliably return ErrShutdown, and that clients see ErrShutdown rather than io.EOF when appropriate. Suggestions welcome for a way to reliably test the mutex issue.

Patch Set 1 #

Patch Set 2 : diff -r 6b42c681480b https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 6b42c681480b https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 6b42c681480b https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r 6b42c681480b https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r 6b42c681480b https://go.googlecode.com/hg/ #

Patch Set 7 : diff -r 6b42c681480b https://go.googlecode.com/hg/ #

Patch Set 8 : diff -r 6b42c681480b https://go.googlecode.com/hg/ #

Patch Set 9 : diff -r cac5b17d8699 https://go.googlecode.com/hg/ #

Patch Set 10 : diff -r cac5b17d8699 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -4 lines) Patch
M src/pkg/net/rpc/client.go View 1 2 3 3 chunks +8 lines, -4 lines 0 comments Download
M src/pkg/net/rpc/server_test.go View 1 2 3 4 5 6 1 chunk +17 lines, -0 lines 0 comments Download

Messages

Total messages: 3
rog
Hello r@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
9 years, 4 months ago (2013-02-15 14:01:25 UTC) #1
iant
LGTM
9 years, 4 months ago (2013-02-15 18:57:07 UTC) #2
rog
9 years, 4 months ago (2013-02-25 16:22:37 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=4bbd9bfda787 ***

net/rpc: avoid racy use of closing flag.

It's accessed without mutex protection
in a different goroutine from the one that
sets it.

Also make sure that Client.Call after Client.Close
will reliably return ErrShutdown, and that clients
see ErrShutdown rather than io.EOF when appropriate.

Suggestions welcome for a way to reliably test
the mutex issue.

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

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