wvq opened a new issue, #1402:
URL: https://github.com/apache/rocketmq-clients/issues/1402

   ### Before Creating the Bug Report
   
   - [x] I found a bug, not just asking a question, which should be created in 
[GitHub Discussions](https://github.com/apache/rocketmq-clients/discussions).
   
   - [x] I have searched the [GitHub 
Issues](https://github.com/apache/rocketmq-clients/issues) and [GitHub 
Discussions](https://github.com/apache/rocketmq-clients/discussions)  of this 
repository and believe that this is not a duplicate.
   
   - [x] I have confirmed that this bug belongs to the current repository, not 
other repositories of RocketMQ.
   
   
   ### Programming Language of the Client
   
   Node.js
   
   ### Runtime Platform Environment
   
   MacOS 16
   
   ### RocketMQ Version of the Client/Server
   
   [email protected]
   
   ### Run or Compiler Version
   
   [email protected]
   
   ### Describe the Bug
   
   BaseClient 的 startup 存在异步回调先后顺序的 bug,
   ``` typescript
   async #startup() {
      // ...
   
      //  这里的await,内部有发请求去拉setting
      await this.updateRoutes();
   
      // ...
   
       if (this.topics.size > 0) {
         // ...
         
         this.logger.info('Waiting for first onSettingsCommand, clientId=%s', 
this.clientId);
         // 这里去等待首次setting回调,但是顶上的await逻辑, setting的回调触发有可能早于这个#startupResolve附值
         await new Promise((resolve, reject) => {
           this.#startupReject = reject
           this.#startupResolve = resolve
         })
         // ...
       }
       // ...
     }
   ````
   
   
   ### Steps to Reproduce
   
   如上面描述
   
   ### What Did You Expect to See?
   
   回调能按期望的代码逻辑顺序执行
   
   ### What Did You See Instead?
   
   回调执行时机是不可确定的
   
   ### Additional Context
   
   _No response_


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