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:
[email protected]


With regards,
Apache Git Services

Reply via email to