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

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

commit 4a668a45f57bd4bbb7152a0817b92738db7f91b3
Author: little-cui <[email protected]>
AuthorDate: Wed Aug 3 11:04:50 2022 +0800

    [fix]syncer health failure
---
 syncer/rpc/server.go           | 1 +
 syncer/service/admin/health.go | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

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..1ed86613 100644
--- a/syncer/service/admin/health.go
+++ b/syncer/service/admin/health.go
@@ -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