-
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 blocking etcd process #7546
Conversation
etcdmain/etcd.go
Outdated
select { | ||
case <-e.Server.ReadyNotify(): // wait for e.Server to join the cluster | ||
case <-e.Server.StopNotify(): // publish aborted from 'ErrStopped' | ||
e.Server.HardStop() |
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.
is this necessary? StopNotify returns done
, so it should only hit this if the etcdserver is already torn down and HardStop isn't needed?
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.
You are right. It's closed when (s *EtcdServer) run()
exits. Will remove.
integration/cluster.go
Outdated
@@ -465,6 +465,8 @@ type member struct { | |||
|
|||
// serverClient is a clientv3 that directly calls the etcdserver. | |||
serverClient *clientv3.Client | |||
|
|||
keepDataDirStop bool |
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.
keepDataDirTerminate bool
? Another option is Stop
the member and remove from c.Members, before calling removeMember on the ID so it never hits Terminate
.
Fix etcd-io#7512. If a server starts and aborts due to config error, it is possible to get stuck in ReadyNotify waits. This adds select case to get notified on stop channel. Signed-off-by: Gyu-Ho Lee <[email protected]>
Signed-off-by: Gyu-Ho Lee <[email protected]>
7532413
to
2d5f890
Compare
OK... Interesting bug. Good fix. |
<-e.Server.ReadyNotify() // wait for e.Server to join the cluster | ||
select { | ||
case <-e.Server.ReadyNotify(): // wait for e.Server to join the cluster | ||
case <-e.Server.StopNotify(): // publish aborted from 'ErrStopped' |
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.
etcdserver/server.go still needs updating? ErrStopped on publish won't hardstop the server
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 was trying HardStop
on ErrStopped case, but process was still halting.
I will add handling in server.go.
lgtm. Thanks! |
Just note: We send |
Codecov Report
@@ Coverage Diff @@
## master #7546 +/- ##
=========================================
Coverage ? 70.55%
=========================================
Files ? 320
Lines ? 26183
Branches ? 0
=========================================
Hits ? 18473
Misses ? 6262
Partials ? 1448
Continue to review full report at Codecov.
|
Fix #7512.
If a server starts and aborts due to config error,
it is possible to get stuck in ReadyNotify waits.
This adds select case to get notified on stop channel.