-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
*: fix races from clientv3/integration tests #4876
*: fix races from clientv3/integration tests #4876
Conversation
heyitsanthony
commented
Mar 27, 2016
b08eb73
to
2a2b4e9
Compare
@@ -165,10 +165,11 @@ func (t *Transport) Send(msgs []raftpb.Message) { | |||
to := types.ID(m.To) | |||
|
|||
t.mu.RLock() | |||
p, ok := t.peers[to] | |||
p, pok := t.peers[to] | |||
g, rok := t.remotes[to] | |||
t.mu.RUnlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch. Would like to test this code to see if we still get #4855.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm, I still see failures even with this. Will investigate more.
lgtm. defer to @xiang90 |
@@ -183,14 +183,14 @@ func (kv *kv) Do(ctx context.Context, op Op) (OpResponse, error) { | |||
} | |||
|
|||
func (kv *kv) switchRemote(prevErr error) error { | |||
kv.mu.Lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not a good idea to hold the lock while doing network io i think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's OK here since switchRemote only happens on connection failure; IO would have to wait for a new connection anyway and canceling the client context can break the lock if it stalls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. add a comment for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
2a2b4e9
to
d91f90c
Compare
lgtm |
merging on greenlight |
semaphore found a new one, will investigate
|
That means we cannot configure in client side. Maybe we should just disable it in init function? |
Unless it's being done in etcdctl, then think we can make it configurable in |
@gyuho I think we can configure it in the client but we'd have to slip in a custom logger on |
func init() { | ||
logger = settableLogger{Logger: log.New(ioutil.Discard, "", 0)} | ||
// disable client side grpc by default | ||
grpclog.SetLogger(&logger) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. defer to @xiang90
d7954f5
to
0c7bc29
Compare
Found in TestElectionWait
Found in TestElectionFailover
b98aa67
to
0b44726
Compare
grpc only permits SetLogger on init()
0b44726
to
161bc5e
Compare
lgtm. |
lgtm |