nodece commented on code in PR #958:
URL: https://github.com/apache/pulsar-client-go/pull/958#discussion_r1109568855


##########
pulsar/internal/rpc_client.go:
##########
@@ -129,14 +129,24 @@ func (c *rpcClient) Request(logicalAddr *url.URL, 
physicalAddr *url.URL, request
                        Cnx:      cnx,
                        Response: response,
                }, err}
-               close(ch)
        })
 
-       select {
-       case res := <-ch:
-               return res.RPCResult, res.error
-       case <-time.After(c.requestTimeout):
-               return nil, ErrRequestTimeOut
+       timeoutCh := time.After(c.requestTimeout)
+       for {
+               select {
+               case res := <-ch:
+                       // Ignoring producer not ready response.
+                       // Continue to wait for the producer to create 
successfully
+                       if res.error == nil && *res.RPCResult.Response.Type == 
pb.BaseCommand_PRODUCER_SUCCESS {
+                               if 
!*res.RPCResult.Response.ProducerSuccess.ProducerReady {
+                                       timeoutCh = nil

Review Comment:
   Do you need to reset `timeoutCh`?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to