-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
*: add basic health check service #8121
Conversation
clientv3/client.go
Outdated
@@ -463,6 +466,15 @@ func (c *Client) checkVersion() (err error) { | |||
// ActiveConnection returns the current in-use connection | |||
func (c *Client) ActiveConnection() *grpc.ClientConn { return c.conn } | |||
|
|||
// CheckHealth checks the health status of gRPC server of current connection. |
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.
don't expose through clientv3 yet? User can get this by healthpb.NewHeathClient(c.ActiveConnection())
already
clientv3/integration/kv_test.go
Outdated
) | ||
|
||
func TestHealth(t *testing.T) { |
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.
this should be in integration/
instead of clientv3/integration/
since it's mostly only testing the server
integration/cluster.go
Outdated
@@ -937,6 +937,10 @@ func (c *ClusterV3) Client(i int) *clientv3.Client { | |||
return c.clients[i] | |||
} | |||
|
|||
func (c *ClusterV3) TerminateMember(t *testing.T, i int) { |
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.
Members
is already exported out of ClusterV3
; function is unnecessary?
8f11d5f
to
df46e1d
Compare
d0bfd87
to
031d3ce
Compare
@heyitsanthony PTAL. |
integration/v3_health_check_test.go
Outdated
@@ -0,0 +1,40 @@ | |||
// Copyright 2017 The etcd Authors |
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.
just v3_health_test.go
?
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
031d3ce
to
8ce2c79
Compare
Address #8022.
This PR uses the default grpc health server https://github.com/grpc/grpc-go/blob/master/health/health.go. Any other suggestion?
Balancer logic is not implemented in this PR.