You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "forgivemyheart (via GitHub)" <gi...@apache.org> on 2023/11/22 02:27:06 UTC

[I] [Bug] topicsOfInterest should pass a reference instead of a value [rocketmq-clients]

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

   ### 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
   
   C++
   
   ### Runtime Platform Environment
   
   all
   
   ### RocketMQ Version of the Client/Server
   
   all 
   
   ### Run or Compiler Version
   
   _No response_
   
   ### Describe the Bug
   
   void SimpleConsumerImpl::topicsOfInterest(std::vector<std::string> topics) {
     absl::MutexLock lk(&subscriptions_mtx_);
     for (const auto& entry : subscriptions_) {
       if (std::find(topics.begin(), topics.end(), entry.first) == topics.end()) {
         topics.push_back(entry.first);
       }
     }
   }
   
   Based on the topicsOfInterest function's intention, which is to modify the input parameter, it should pass a reference instead of a value.
   
   ### Steps to Reproduce
   
   code error
   
   ### What Did You Expect to See?
   
   Input parameters are modified correctly
   
   ### What Did You See Instead?
   
   The input parameters have not been modified
   
   ### 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: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] topicsOfInterest should pass a reference instead of a value [rocketmq-clients]

Posted by "lizhanhui (via GitHub)" <gi...@apache.org>.
lizhanhui closed issue #639: [Bug] topicsOfInterest should pass a reference instead of a value
URL: https://github.com/apache/rocketmq-clients/issues/639


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] topicsOfInterest should pass a reference instead of a value [rocketmq-clients]

Posted by "forgivemyheart (via GitHub)" <gi...@apache.org>.
forgivemyheart commented on issue #639:
URL: https://github.com/apache/rocketmq-clients/issues/639#issuecomment-1825355651

   It seems that it was correct before the modification .Support client metric exporting (https://github.com/apache/rocketmq-clients/pull/39),it's simi


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] topicsOfInterest should pass a reference instead of a value [rocketmq-clients]

Posted by "lizhanhui (via GitHub)" <gi...@apache.org>.
lizhanhui commented on issue #639:
URL: https://github.com/apache/rocketmq-clients/issues/639#issuecomment-1835316095

   @forgivemyheart I've created a pull request, you may have a review if you like


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] topicsOfInterest should pass a reference instead of a value [rocketmq-clients]

Posted by "lizhanhui (via GitHub)" <gi...@apache.org>.
lizhanhui commented on issue #639:
URL: https://github.com/apache/rocketmq-clients/issues/639#issuecomment-1822349378

   This method is abused. It carries two different semantics in different places and we need to fix it. You are welcome to create a pull request.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] topicsOfInterest should pass a reference instead of a value [rocketmq-clients]

Posted by "lizhanhui (via GitHub)" <gi...@apache.org>.
lizhanhui commented on issue #639:
URL: https://github.com/apache/rocketmq-clients/issues/639#issuecomment-1825421223

   > It seems that it was correct before the modification .Support client metric exporting (#39)
   
   Right...That is when a second use case was introduced and things are messed up. If you have interest, you may create a pull request to get things fixed and I am glad to review and have it rectified.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] topicsOfInterest should pass a reference instead of a value [rocketmq-clients]

Posted by "forgivemyheart (via GitHub)" <gi...@apache.org>.
forgivemyheart commented on issue #639:
URL: https://github.com/apache/rocketmq-clients/issues/639#issuecomment-1825355652

   It seems that it was correct before the modification .Support client metric exporting (https://github.com/apache/rocketmq-clients/pull/39)


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org