go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

would it possible to add client grpc health check ?

Open Danny5487401 opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. when i port forward k8s svc ,it is reasonable to fail when stoping the port fowarding. But port forward k8s svc again in the same port, the conn is still bad.It only works after restarting the service.

Describe the solution you'd like image

hope to add sequent settings.


svcCfg := fmt.Sprintf(`{"loadBalancingPolicy":"%s","healthCheckConfig": {
		"serviceName": ""
	}}`, p2c.Name)
	

this is just like what grpc-go does. And I know go-zero already achieved rpc health check in the server end image

Additional context Hope to get yr early reply! @kevin0527

Danny5487401 avatar Jul 15 '22 06:07 Danny5487401

We have load balancer to actively detect the server status by requests. Any benefits to have this kind of client side health check?

kevwan avatar Jul 19 '22 15:07 kevwan

it does not help too much when already having the load balancer. But i guess it will help a little when rpc server stops because client will receive the stream immediately to mark the connection state Close. And the k8s endpoint will still be alive in the short rpc server closing time.

By the way, is it possible to improve performance in a large big loop if at the same time checking the connectity state in p2cPicker.

image

Danny5487401 avatar Jul 20 '22 05:07 Danny5487401

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Aug 08 '23 01:08 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Mar 21 '24 01:03 github-actions[bot]