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 2022/10/09 08:59:12 UTC

[GitHub] [rocketmq-client-go] 0daypwn opened a new issue, #927: the offset in the processQueue were not removed correctly

0daypwn opened a new issue, #927:
URL: https://github.com/apache/rocketmq-client-go/issues/927

   The issue tracker is **ONLY** used for the go client (feature request of RocketMQ need to follow [RIP process](https://github.com/apache/rocketmq/wiki/RocketMQ-Improvement-Proposal)). Keep in mind, please check whether there is an existing same report before your raise a new one.
   
   Alternately (especially if your communication is not a bug report), you can send mail to our [mailing lists](http://rocketmq.apache.org/about/contact/). We welcome any friendly suggestions, bug fixes, collaboration, and other improvements.
   
   Please ensure that your bug report is clear and that it is complete. Otherwise, we may be unable to understand it or to reproduce it, either of which would prevent us from fixing the bug. We strongly recommend the report(bug report or feature request) could include some hints as to the following:
   
   **BUG REPORT**  
   1. Please describe the issue you observed:
   
       - What did you do (The steps to reproduce)?
       producer send message very fast.
       consumer consume message very fast.
   
       - What did you expect to see?
       
   
       - What did you see instead?
       some process queue's cache offset may not remove correctly.
   
   2. Please tell us about your environment:
   
        - What is your OS?
   
        - What is your client version?
           v2.1.1
   
        - What is your RocketMQ version?
   
   3. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):
     processQueue put message order:
     1. (pq.putMessage)put messages to channel pq.msgCh
     2. (pq.putMessage)lock pq.mutex
     3. (pq.putMessage)put messages to map pq.msgCache
     4. (pq.putMessage)unlock pq.mutex
       
   <img width="557" alt="3273d497-84b7-41fd-a0fa-58ba20965071" src="https://user-images.githubusercontent.com/30897509/194747376-10a0770e-3a8e-45f5-a5d3-cd48e3ba19af.png">
   
   
     conumse message order:
     1. (pq.getMessages)get messages from channel pq.msgCh
     2. consumerInner
     3. if consume success, do remove message
     4. (pq.removeMessage)lock pq.mutex
     6. (pq.removeMessage)remove messages from map pq.msgCache
     7. (pq.removeMessage)unlock pq.mutex
   <img width="608" alt="58b7595e-ff78-4a6e-abda-569ad6033738" src="https://user-images.githubusercontent.com/30897509/194747461-f8b5f8e0-d1b7-4dac-8fc2-e49e1c06973c.png">
   
   
   In high concurrency scenarios, the order may be out of order.
       1. (pq.putMessage)put messages to channel pq.msgCh
       2. (pq.getMessages)get messages from channel pq.msgCh
       3. consumerInner
       4. if consume success, do remove message
       5. (removeMessage)lock pq.mutex
       6. (removeMessage)remove messages from map pq.msgCache.  **At this time, the offset is not in the map.**
       9. (removeMessage)unlock pq.mutex
       10. (pq.putMessage)lock pq.mutex
       11. (pq.putMessage)put messages to map pq.msgCache  **No one will delete it again.**
       12. (pq.putMessage)unlock pq.mutex


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

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


[GitHub] [rocketmq-client-go] ShannonDing closed issue #927: the offset in the processQueue were not removed correctly

Posted by GitBox <gi...@apache.org>.
ShannonDing closed issue #927: the offset in the processQueue were not removed correctly
URL: https://github.com/apache/rocketmq-client-go/issues/927


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