You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/12/17 09:49:29 UTC

[GitHub] wanghancai opened a new issue #512: 服务重新注册成功后更新属性失败

wanghancai opened a new issue #512: 服务重新注册成功后更新属性失败
URL: https://github.com/apache/servicecomb-service-center/issues/512
 
 
   服务重新注册时,只要查到实例就不会再更新ttl导致,长时间出现实例实例下线;需要SC收到注册并返回成功前重置ttl
   func (s *InstanceService) Register(ctx context.Context, in *pb.RegisterInstanceRequest) (*pb.RegisterInstanceResponse, error) {
   	remoteIP := util.GetIPFromContext(ctx)
           ........
   	instance := in.GetInstance()
   
   	//允许自定义id
   	//如果没填写 并且endpoints沒重復,則产生新的全局instance id
   	oldInstanceId, checkErr := serviceUtil.InstanceExist(ctx, in.Instance)
   	if checkErr != nil {
                   .......
   		return &pb.RegisterInstanceResponse{Response: resp}, nil
   	}
   	if len(oldInstanceId) > 0 {
   		log.Infof("register instance successful, reuse service %s instance %s, operator %s",
   			instance.ServiceId, oldInstanceId, remoteIP)
   		return &pb.RegisterInstanceResponse{
   			Response:   pb.CreateResponse(pb.Response_SUCCESS, "instance more exist"),
   			InstanceId: oldInstanceId,
   		}, nil
   	}
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services