You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2020/03/11 09:53:36 UTC

[GitHub] [rocketmq-client-go] ShannonDing commented on a change in pull request #445: fix(producer): UpdateNameServerAddress shoule be called before producer start, or namesrvs list will be empty, lead to a panic

ShannonDing commented on a change in pull request #445: fix(producer): UpdateNameServerAddress shoule be called before producer start, or namesrvs list will be empty, lead to a panic
URL: https://github.com/apache/rocketmq-client-go/pull/445#discussion_r390855108
 
 

 ##########
 File path: internal/route.go
 ##########
 @@ -339,6 +339,15 @@ func (s *namesrvs) queryTopicRouteInfoFromServer(topic string) (*TopicRouteData,
 		response *remote.RemotingCommand
 		err      error
 	)
+
+	//if s.Size() == 0, response will be nil, lead to panic below.
+	if s.Size() == 0 {
+		rlog.Error("namesrv list empty. UpdateNameServerAddress should be called first.", map[string]interface{}{
+			"namesrv": s,
 
 Review comment:
   s.size ==0, then print s.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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