This is an automated email from the ASF dual-hosted git repository.

littlecui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git


The following commit(s) were added to refs/heads/master by this push:
     new 20240cf5 [fix]syncer health failure (#1322)
20240cf5 is described below

commit 20240cf563f0c2bc18c21dfea380cda4ad43bc65
Author: little-cui <[email protected]>
AuthorDate: Wed Aug 3 17:26:15 2022 +0800

    [fix]syncer health failure (#1322)
    
    * [fix]syncer health failure
    
    * [fix]syncer health failure
---
 syncer/rpc/server.go           | 1 +
 syncer/service/admin/health.go | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/syncer/rpc/server.go b/syncer/rpc/server.go
index 5601b0a1..990f7894 100644
--- a/syncer/rpc/server.go
+++ b/syncer/rpc/server.go
@@ -77,6 +77,7 @@ func (s *Server) Health(_ context.Context, _ 
*v1sync.HealthRequest) (*v1sync.Hea
        // TODO enable to close syncer
        if !config.GetConfig().Sync.EnableOnStart {
                resp.Status = HealthStatusClose
+               log.Error("unexpected health check when syncer is closed", nil)
                return resp, nil
        }
        return resp, nil
diff --git a/syncer/service/admin/health.go b/syncer/service/admin/health.go
index 5a6e1c49..60ec7101 100644
--- a/syncer/service/admin/health.go
+++ b/syncer/service/admin/health.go
@@ -35,7 +35,7 @@ import (
 )
 
 const (
-       scheme      = "health_rpc"
+       scheme      = "grpc"
        serviceName = "syncer"
 )
 
@@ -130,7 +130,7 @@ func getPeerStatus(peerName string, clientConn 
*grpc.ClientConn) string {
        set := client.NewSet(clientConn)
        reply, err := set.EventServiceClient.Health(context.Background(), 
&v1sync.HealthRequest{})
        if err != nil || reply == nil {
-               log.Warn("health request is err")
+               log.Error("get peer health failed", err)
                return rpc.HealthStatusAbnormal
        }
        reportClockDiff(peerName, local, reply.LocalTimestamp)

Reply via email to