diff --git a/common/pkgs/connectivity/collector.go b/common/pkgs/connectivity/collector.go index e8c14fc..6234cd9 100644 --- a/common/pkgs/connectivity/collector.go +++ b/common/pkgs/connectivity/collector.go @@ -178,7 +178,7 @@ func (r *Collector) ping(node cdssdk.Node) Connectivity { defer stgglb.AgentRPCPool.Release(agtCli) // 第一次ping保证网络连接建立成功 - err = agtCli.Ping(*stgglb.Local.NodeID) + err = agtCli.Ping() if err != nil { log.Warnf("pre ping: %v", err) return Connectivity{ @@ -192,7 +192,7 @@ func (r *Collector) ping(node cdssdk.Node) Connectivity { var avgDelay time.Duration for i := 0; i < 3; i++ { start := time.Now() - err = agtCli.Ping(*stgglb.Local.NodeID) + err = agtCli.Ping() if err != nil { log.Warnf("ping: %v", err) return Connectivity{ diff --git a/common/pkgs/grpc/agent/agent.pb.go b/common/pkgs/grpc/agent/agent.pb.go index 1e70002..4237f4f 100644 --- a/common/pkgs/grpc/agent/agent.pb.go +++ b/common/pkgs/grpc/agent/agent.pb.go @@ -390,8 +390,6 @@ type PingReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - FromNodeID int64 `protobuf:"varint,1,opt,name=FromNodeID,proto3" json:"FromNodeID,omitempty"` } func (x *PingReq) Reset() { @@ -426,13 +424,6 @@ func (*PingReq) Descriptor() ([]byte, []int) { return file_pkgs_grpc_agent_agent_proto_rawDescGZIP(), []int{6} } -func (x *PingReq) GetFromNodeID() int64 { - if x != nil { - return x.FromNodeID - } - return 0 -} - type PingResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -500,10 +491,8 @@ var file_pkgs_grpc_agent_agent_proto_rawDesc = []byte{ 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x6c, 0x61, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x50, 0x6c, 0x61, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x44, 0x22, 0x29, 0x0a, 0x07, - 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x46, 0x72, 0x6f, 0x6d, 0x4e, - 0x6f, 0x64, 0x65, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x46, 0x72, 0x6f, - 0x6d, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x22, 0x0a, 0x0a, 0x08, 0x50, 0x69, 0x6e, 0x67, 0x52, + 0x28, 0x09, 0x52, 0x08, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x44, 0x22, 0x09, 0x0a, 0x07, + 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x22, 0x0a, 0x0a, 0x08, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x2a, 0x37, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x45, 0x4f, 0x46, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x10, 0x01, 0x12, 0x0c, diff --git a/common/pkgs/grpc/agent/agent.proto b/common/pkgs/grpc/agent/agent.proto index 7f08bde..696d30a 100644 --- a/common/pkgs/grpc/agent/agent.proto +++ b/common/pkgs/grpc/agent/agent.proto @@ -40,9 +40,7 @@ message FetchStreamReq { string StreamID = 2; } -message PingReq { - int64 FromNodeID = 1; -} +message PingReq {} message PingResp {} service Agent { diff --git a/common/pkgs/grpc/agent/client.go b/common/pkgs/grpc/agent/client.go index 74ea749..8b570c4 100644 --- a/common/pkgs/grpc/agent/client.go +++ b/common/pkgs/grpc/agent/client.go @@ -5,7 +5,6 @@ import ( "fmt" "io" - cdssdk "gitlink.org.cn/cloudream/common/sdks/storage" "gitlink.org.cn/cloudream/storage/common/pkgs/ioswitch" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" @@ -210,10 +209,8 @@ func (c *Client) FetchStream(planID ioswitch.PlanID, streamID ioswitch.StreamID) }, nil } -func (c *Client) Ping(fromNodeID cdssdk.NodeID) error { - _, err := c.cli.Ping(context.Background(), &PingReq{ - FromNodeID: int64(fromNodeID), - }) +func (c *Client) Ping() error { + _, err := c.cli.Ping(context.Background(), &PingReq{}) return err }